LLBLGen with large DBs?

Posts   
 
    
Ganesh
User
Posts: 28
Joined: 18-May-2005
# Posted on: 18-May-2005 23:45:10   

Hello all,

I am new to LLBLGen and I started using it for couple of weeks only. Here is the list of issues that I am not able to figure it out and would appreciate if some one else can help on this one....

(1) We have 1200+ tables and we are supporting both Sql Server and Oracle. Can I have a single LLBLGen project to manage both DBs (since the table structures are same)?

(2) I tried to gen with all the 1200+ tables and found out that the assembly size is 19MB, does it will cause a performance issue? or whats the best approach in this scenario?

(3) In a project can I have multiple DBGeneric but one single DBSpecific?

(4) I think the above question can be answered if I do a Subset (grouping) while generating the code?, but I will end up having multiple DBGeneric and DBSpecifics and maintenance could be little cumbersome I would think? confused

Thanks and appreciate your response on this. Ganesh sunglasses

NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 19-May-2005 00:14:43   

Ganesh wrote:

Hello all,

I am new to LLBLGen and I started using it for couple of weeks only. Here is the list of issues that I am not able to figure it out and would appreciate if some one else can help on this one....

(1) We have 1200+ tables and we are supporting both Sql Server and Oracle. Can I have a single LLBLGen project to manage both DBs (since the table structures are same)?

First, let me say 1200+ frowning !!! WOW!!

Secondly, you will want to use Adapter mode for this, because this is exactly what it was built for.

Ganesh wrote:

(2) I tried to gen with all the 1200+ tables and found out that the assembly size is 19MB, does it will cause a performance issue? or whats the best approach in this scenario?

I have 300+ in mine and performance is pretty good. You'll have to wait a few minutes for .NET to recompile your DAL code after making changes in the LLBLGen designer than you will waiting for LLBLGen to generate all that nifty code for you. So, just make sure to turn incremental compile on for your database generic project and you'll be just fine. The only other noticeable performance hit is when I'm using Intellisense and I create a new predicate comparison. The first time it takes about four or five seconds for some list to be built in Intellisense.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 19-May-2005 10:26:00   

Ganesh wrote:

Hello all,

I am new to LLBLGen and I started using it for couple of weeks only. Here is the list of issues that I am not able to figure it out and would appreciate if some one else can help on this one....

(1) We have 1200+ tables and we are supporting both Sql Server and Oracle. Can I have a single LLBLGen project to manage both DBs (since the table structures are same)?

No, you need 2 projects. You then generate using Adapter two code bases, and of one you keep the database generic vs.net project. You keep the database specific vs.net project of both.

A converter is in the works which will allow you to convert a .lgp file from sqlserver to oracle and vice versa, but that's not done yet.

When supporting 2 or more databases like sqlserver and oracle, keep in mind that you have to make sure the fields in the tables are named the same and in the same order as in the other database. Also the types should be compatible. This means: no bit/unique_identifier types on sqlserver as Oracle doesn't support these and doesn't have a type which can mimic them

(2) I tried to gen with all the 1200+ tables and found out that the assembly size is 19MB, does it will cause a performance issue? or whats the best approach in this scenario?

  • use adapter, the code base of adapter is much smaller. (you need to, you want to support multiple databases)
  • a large compiled assembly doesn't matter, code is shared among all instances of objects, so only load times are a problem. The code base is mostly very large because of the PredicateFactory class. This is a helperclass which is very large in large projects, as for each table a set of methods are created.

To keep sizes down in the generated code, you can remove this file from the project and recompile. The class can be placed in another vs.net project for example if you want to. The predicatefactory class makes it easier to create predicates, though you can also use the FieldCompare..Predicate classes directly.

(3) In a project can I have multiple DBGeneric but one single DBSpecific?

You need one DBGeneric and multiple DBSpecific projects. DBGeneric is shared among all databases, and for each database you have one DBSpecific project. Then create a small factory which returns a DataAccessAdapter instance for the right database.

(4) I think the above question can be answered if I do a Subset (grouping) while generating the code?, but I will end up having multiple DBGeneric and DBSpecifics and maintenance could be little cumbersome I would think? confused

yes I think so too. Though you can also solve it differently: create multiple .lgp projects on the same schema/catalog and add to each project only those tables you want to use in a group. In a large database as yours, it's often the case that there are groups of tables, not one big schema, so create one .lgp file (LLBLGen Pro project) on each table group. Of course having relations between them is hten not possible, so you have to make sure this is something you can use in your case.

Frans Bouma | Lead developer LLBLGen Pro
Ganesh
User
Posts: 28
Joined: 18-May-2005
# Posted on: 19-May-2005 20:32:52   

Thanks for your reply. I think that will help me a lot to begin with.

(3) In a project can I have multiple DBGeneric but one single DBSpecific?

You need one DBGeneric and multiple DBSpecific projects. DBGeneric is shared among all databases, and for each database you have one DBSpecific project. Then create a small factory which returns a DataAccessAdapter instance for the right database.

Could you please provide a code sample of "creating a small factory which returns a DataAccessAdapter instance for the right database"? smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-May-2005 12:00:25   

Ganesh wrote:

Thanks for your reply. I think that will help me a lot to begin with.

(3) In a project can I have multiple DBGeneric but one single DBSpecific?

You need one DBGeneric and multiple DBSpecific projects. DBGeneric is shared among all databases, and for each database you have one DBSpecific project. Then create a small factory which returns a DataAccessAdapter instance for the right database.

Could you please provide a code sample of "creating a small factory which returns a DataAccessAdapter instance for the right database"? smile

sob I worked so hard on the new search engine wink

-> http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3080

Frans Bouma | Lead developer LLBLGen Pro
Ganesh
User
Posts: 28
Joined: 18-May-2005
# Posted on: 20-May-2005 21:38:01   

Thank you! sunglasses