Switching between Oracle and SQL-Server

Posts   
 
    
Slowhand
User
Posts: 96
Joined: 07-Mar-2006
# Posted on: 08-Mar-2006 12:12:54   

Hello, in out new application we need to switch between Oracle and SQL-Server.

Is there a way or a workaround to do this with LLBLGen Pro ?

Thank you for your help .

Slowhand

Kris
User
Posts: 79
Joined: 27-Oct-2005
# Posted on: 08-Mar-2006 14:08:12   

Slowhand wrote:

Hello, in out new application we need to switch between Oracle and SQL-Server.

Is there a way or a workaround to do this with LLBLGen Pro ?

Thank you for your help .

Slowhand

Regenerate the business layer for Oracle?

Slowhand
User
Posts: 96
Joined: 07-Mar-2006
# Posted on: 08-Mar-2006 14:23:55   

Can you describe this scenario, cause I´m new here ...

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 08-Mar-2006 15:50:28   

You should use the Adapter Scenario to generate your code.

This will generate 2 projects for you : 1- DBSpecific project
2- DBGeneric project

So basicly you should have the 2 databases identical (same names everywhere) Then you would create a LLBLGen Pro project for each. Note: coming soon, is a tool that you may use tol migrate an LLBLGen Pro project to another, rather than having to create it again, defining things like typed lists.

Use one of those DBGeneric generated (any one) And use the DBSpecifc generated for each database.

Then you may usel either DBspecific project's DataAccessAdapter object to access the database. And pass the connection string to the DataAccessAdapter object's constructor.

Please refer to the following threads for further help: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=2095 http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3080

DavidThi808 avatar
Posts: 6
Joined: 21-Mar-2006
# Posted on: 21-Mar-2006 17:36:18   

Hello;

Is it possible to have just a DBGeneric set of classes so my connectstring is unique for each vendor/database but the rest of my code is identical (assume identical tables with identical columns & identical names/types)?

thanks - dave

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 21-Mar-2006 17:52:32   

DavidThi808 wrote:

Hello;

Is it possible to have just a DBGeneric set of classes so my connectstring is unique for each vendor/database but the rest of my code is identical (assume identical tables with identical columns & identical names/types)?

thanks - dave

Yes. Though you need per db a DBSpecific project, which contains the persistence logic for a db, and for example type converters if you want to use for example boolean types in your code which targets both sqlserver and oracle (as oracle doesn't support bools). LLBLGen Pro stores its persistence logic in code rather than data structures. This is done to save memory and also to be faster when the data is needed.

Frans Bouma | Lead developer LLBLGen Pro
DavidThi808 avatar
Posts: 6
Joined: 21-Mar-2006
# Posted on: 21-Mar-2006 19:02:30   

Hi;

I want to make sure I understand this correctly. I can have a generic set of classes/objects I operate on. But I also need to build/create the database specific objects for each database so LLBLGen can call those database specific objects from the code inside the generic objects I am using.

Is this correct? And I assume this means when you add support for another database, that we then need to generate objects for that database and then rebuild our program?

thanks - dave

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 21-Mar-2006 19:23:23   

That is correct simple_smile

We have a converter application which is almost out of beta (due to deadlines for v2, we put that on hold for now, but the code is done) which should convert a .lgp file (llblgen pro project) from one db to another, which then would allow you to run a template which generates DDL SQL for you to build the db to get started.

Frans Bouma | Lead developer LLBLGen Pro