Database platform independence

Posts   
 
    
adamw5
User
Posts: 3
Joined: 05-Jan-2011
# Posted on: 05-Jan-2011 11:44:15   

Hi guys

I am not sure if I have misunderstood the intent of mapping multiple databases to a single set of entities in LLBLGen Pro.

I'm creating an application that purports to function against both SQL Server and Oracle. I've successfully reverse engineered both databases and created a set of entities which has mappings to the database on both platforms.

However upon generating the code (SelfServicing or Adapter), I get two separate projects generated, one for each database platform.

Is there a way to generate a single project such that my application can function in a database independent manner (i.e. the database platform target would be dependent on the connection string and/or catalog name overwrite values).

Thank you.

Adam

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Jan-2011 11:55:01   

I'm not sure I understand your case.

Do the 2 databases (SQL & Oracle) have the same schema (i.e. set of entities)? And you will need to use either of them at runtime?

Or each have a different schema and so a different set of entities and you will need to use both at the same time at runtime?

adamw5
User
Posts: 3
Joined: 05-Jan-2011
# Posted on: 05-Jan-2011 11:59:23   

Hi Walaa

Essentially I want a single project for my system, with a single LLBLGen data project that can target both SQL Server and Oracle, not simultaneously, but dependent on the end user's choice of database platform.

So each client would have the same deployed project, but if they change their connection string (in web.config) to an SQL Server connection string, it will use sql server, and an Oracle connection string it will use Oracle.

I want a single set of generated entities that are independent of the database platform. I assume then the query engine is responsible for generating the appropriate SQL for the appropriate platform.

The database schema is the same on both Oracle and SQL Server (with obvious small differences, e.g. a NUMBER(9,0) for an int32 on Oracle and an INT for SQL Server). The mappings should take care of this yes? (I've used TypeCOnverters where appropriate).

Thanks Adam

Walaa wrote:

I'm not sure I understand your case.

Do the 2 databases (SQL & Oracle) have the same schema (i.e. set of entities)? And you will need to use either of them at runtime?

Or each have a different schema and so a different set of entities and you will need to use both at the same time at runtime?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Jan-2011 15:43:22   
adamw5
User
Posts: 3
Joined: 05-Jan-2011
# Posted on: 05-Jan-2011 23:42:10   

Thanks guys.

My confusion was when I generated the Adapter code (it was clear SelfServicing wasn't going to work) and did not see the separate DB Specific projects and single Generic project.

Seems to all be fine now..

Adam