co-development on SqlServer and Oracle

Posts   
 
    
Peeyush81
User
Posts: 4
Joined: 03-Feb-2009
# Posted on: 03-Feb-2009 12:44:47   

Hi,

I am evaluating LLBLGen Pro for an application which should support a database schema on both oracle and SQL server. The schema on both the databases would be identical except the technical variations. I used the designer to create some initial classes with the SQL Server instance and could load values from the db successfully. One of the requirements of the application architecture is to have a single DAL layer which should by near total opaque to the developer in terms of the underlying DB vendor. I liked the feature of two projects generated by the designer , generic and specific. But one issue which I could not get a solution for, was to use the same designer project to support two DB vendors at the same time. I am trying to do this to generate at the same time, from the same designer project, the DAL layer codebase to work with Oracle and Sql Server , but I cant find a way to do this.

What are the best practices for such a scenario where I want to keep a single designer project and generate code for both databases?

Thanks, Peeyush

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 03-Feb-2009 16:23:48   

You can't do it from one project, unfortunatly. The standard procedure is as follows.

  1. Create a separate llblgen projects for each database type that you want to interface to.
  2. Change the ConnectionStringKeyName "Project property" for projects. For example "SQL.ConnectionString" and "Oracle.ConnectionString". This way DBSpecific projects could distinguish the connection string.
  3. Choose one of these llblgen projects as my "master" project.
  4. Generate the code out of both projects.
  5. Take both the DB Generic and DB Specific VS projects out of the llblgen "master" project. Take only the DB Specific VS project out of the other llblgen project.
  6. Now, put all together in a VS solution. You now have a solution with two DBScpecific projects and one DBGeneric one.

Persistence information is determined based on EntityName and EntityFieldName. You have to be sure the entity names and entity field names are the same in both projects.

There is also a ProjectConverter available in the downloads section which will convert .lgp projects from one database to another so you only need to maintain one .lgp project.

Peeyush81
User
Posts: 4
Joined: 03-Feb-2009
# Posted on: 07-Feb-2009 07:35:21   

The first approach did not work for me. I tried creating a sample project with just one entity based on a single table in both oracle and sql server and even that gave a lot of trouble. For some unknown reason, the name of the entities generated in the two dbs differed in the character case (E.g. the sql server - MyTableName , for Oracle - Mytablename) on its own. So when I used the sql server as the master project, it threw an error while accessing the oracle table, it threw an error of unrecognized entityname. When I manually corrected the entity name for the oracle project, the same problem recurred for a column name. I used ODP .net 9 for the oracle project and ADO .net for the sql server project I looked around a bit in the downloads section but I could not find a project converter any where. With the former experience, I think that should be the way to go. Can you point me to a link to download it?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 10-Feb-2009 22:04:20   

Project convertor

You need to be logged into the main website (not the forums) with your customer ID and password first.

Matt

Peeyush81
User
Posts: 4
Joined: 03-Feb-2009
# Posted on: 11-Feb-2009 14:59:33   

MTrinder wrote:

Project convertor

You need to be logged into the main website (not the forums) with your customer ID and password first.

Matt

http://www.llblgen.com/pages/Support.aspx

does it imply that i have to purchase a license to get the customer id and password?

Cant I evaluate it before hand?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 12-Feb-2009 17:43:45   

It's distributed as sourcecode and as it manipulates projects, it requires a license.

I see your problem with evaluation though. I can email you a release build version, does the email you registered at the forums accept .zip attachments?

Frans Bouma | Lead developer LLBLGen Pro
Peeyush81
User
Posts: 4
Joined: 03-Feb-2009
# Posted on: 17-Feb-2009 10:15:18   

yes it does. I will be waiting for your mail.

Thanks, Peeyush

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 17-Feb-2009 12:03:24   

Sent

Frans Bouma | Lead developer LLBLGen Pro