Multi-Database Support

Posts   
 
    
mdominguez
User
Posts: 14
Joined: 30-May-2005
# Posted on: 06-Jul-2005 18:40:15   

Hi,

We need that our application works with SQLServer and with Oracle.

We follow your indications and we migrate our schema to oracle creating an llblgen pro project from that, generate adapter code and we throw away the db generic project.

We instance the Oracle dbspecific project instead of instantiating the DataAccessAdapter class from the SqlServer dbspecific project.

confused And do not work. (I think must be a problem with the migrated schema).

The question is. It's possible that this work if we only overwrite the dal and the dalDBSpecific libraries? This is, we make two identical projects one for SQL and one for Oracle, compile the libraries with the same name (dal and dalDBSpecific). If the app works with the SQL libraries works it overwriting them with the Oracle ones?.

And for doing the task of duplicate the project. Is there a copy/translate utility for do that? We need that tool !!!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 07-Jul-2005 10:44:36   

mdominguez wrote:

Hi,

We need that our application works with SQLServer and with Oracle.

We follow your indications and we migrate our schema to oracle creating an llblgen pro project from that, generate adapter code and we throw away the db generic project.

We instance the Oracle dbspecific project instead of instantiating the DataAccessAdapter class from the SqlServer dbspecific project.

confused And do not work. (I think must be a problem with the migrated schema).

The question is. It's possible that this work if we only overwrite the dal and the dalDBSpecific libraries? This is, we make two identical projects one for SQL and one for Oracle, compile the libraries with the same name (dal and dalDBSpecific). If the app works with the SQL libraries works it overwriting them with the Oracle ones?.

You don't need them to have the same names, you just have 3 projects: one dbgeneric, and 2 dbspecific.

What exactly didn't work? It would be great if you could provide more detailed information simple_smile

And for doing the task of duplicate the project. Is there a copy/translate utility for do that? We need that tool !!!

That tool is in development.

Frans Bouma | Lead developer LLBLGen Pro
mdominguez
User
Posts: 14
Joined: 30-May-2005
# Posted on: 07-Jul-2005 15:46:58   

This is the way that we try:

instead of:

DataAccessAdapter adapter = new DataAccessAdapter()
adapter.FetchEntityCollection(list, filter, prefetchpath);

we do:

 string assembly = ConfigurationSettings.AppSettings["AssemblyDataAccessPath"];
 IDataAccessAdapter adapter = myFactory.newDataAccess(assembly)
 adapter.FetchEntityCollection(list, filter, path);

we have three VS projects:

1: myoracle_dal
2: myoracle_dalDBSpecific
3: mymssql_dalDBSpecific    --> The mymssql_dal go to trash!!

Well, we configure dinamically the "AssemblyDataAccessPath" setting to myoracle_dalDBSpecific assembly or to mymsql_dalDBSpecific

When we try with the myoracle_dalDBSpecific the app works fine. But when we try with mymssql_dalDBSpecific we have this exception:

System.IndexOutOfRangeException

in the CreateSelectDQ method of DataAccessAdapter class

This is the trace of the Fetch:

Method Enter: DataAccessAdapterBase.FetchEntityCollection(3)
Method Enter: DataAccessAdapterBase.FetchEntityCollection(6)
Active Entity Collection Description: 
    EntityCollection: es.novasoft.xsia.his.novahis.dal.HelperClasses.EntityCollection.  Will contain entities of type: CamaEntity

'testHIS.exe': se cargó 'c:\src\xsiahis\testhis\bin\debug\sd.llblgen.pro.dqe.sqlserver.net11.dll', no se pueden cargar símbolos.
Method Enter: CreateSelectDQ (Paging)
Method Enter: CreateSelectDQ
Method Exit: CreateSelectDQ
Method Exit: CreateSelectDQ (Paging): no paging.
Method Enter: DataAccessAdapterBase.ExecuteMultiRowRetrievalQuery
Method Enter: DataAccessAdapterBase.OpenConnection
'testHIS.exe': se cargó 'c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.thunk.dll', no se pueden cargar símbolos.
'testHIS.exe': se cargó 'c:\windows\assembly\gac\mscorlib.resources\1.0.5000.0_es_b77a5c561934e089\mscorlib.resources.dll', no se pueden cargar símbolos.
Method Exit: DataAccessAdapterBase.OpenConnection
Method Enter: EntityCollectionBase2.Add
Entity to Add Description: 
    Entity: es.novasoft.xsia.his.novahis.biz.CamaEntity2. ObjectID: 6b4f1c45-883f-4673-8197-688a4c6c82ea
    PrimaryKey field: CodCama. Type: System.String. Value: 2
Index of added entity: 0
Method Exit: EntityCollectionBase2.Add
Method Enter: EntityCollectionBase2.Add
Entity to Add Description: 
    Entity: es.novasoft.xsia.his.novahis.biz.CamaEntity2. ObjectID: b0e2a38a-4f53-489b-ba08-48bb20aa9344
    PrimaryKey field: CodCama. Type: System.String. Value: 1
Index of added entity: 1
Method Exit: EntityCollectionBase2.Add
Method Enter: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.ExecuteMultiRowRetrievalQuery
Method Exit: DataAccessAdapterBase.FetchEntityCollection(6)
Method Enter: DataAccessAdapterBase.FetchPrefetchPath
Method Enter: DataAccessAdapterBase.FetchEntityCollection(6)
Active Entity Collection Description: 
    EntityCollection: es.novasoft.xsia.his.novahis.dal.HelperClasses.EntityCollection.  Will contain entities of type: IngresoEntity

Method Enter: CreateSelectDQ (Paging)
Method Enter: CreateSelectDQ
Excepción no controlada del tipo 'System.IndexOutOfRangeException' en sd.llblgen.pro.dqe.sqlserver.net11.dll
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 07-Jul-2005 17:58:44   

This is a typical error caused by the fact that there are more fields in the entity than there are in the table. This means that the query engine gets for example 6 fields, but just for 5 fields persistence info, and causes an error.

Could you please check if your sqlserver table is indeed correct and has the same layout as the oracle one?

Frans Bouma | Lead developer LLBLGen Pro