Project converter, DDL, and relation cascade

Posts   
 
    
Max avatar
Max
User
Posts: 221
Joined: 14-Jul-2006
# Posted on: 21-Sep-2006 16:46:52   

I'm using LLBLGen 2 on VS 2005, adapter template. I need to support both MSAccess and SQL Server.

I'm getting some problem about relation cascade actions (delete cascade / update cascade).

I've converted my MSAccess based LLBL project to SQL Server. I've generated the DDL for SQL Server.

But running the DDL will generate many errors worrying about cyclic or multiple path cascade action. And the relations aren’t created disappointed I know that SQL Server is more restrictive about cyclic cascade action on relation, respect others RDBMS. I’ll need to speak about that with the DBA sunglasses

Now I've some question from the LLBLGen Pro viewpoint:

*) Do LLBLGen generated code rely on relation cascade action in the database?

If the answer is "no" then I can generate: - DBGeneric+DBSpecific code using Access LLBL Project - DBSpecific code for SQL Server using the converted project and everything shall run fine, even if the database have different cascade relation action. simple_smile

*) Do LLBLGen designer extract relation cascade action information from analyzed DB?

If "yes" *) Do LLBLGen Project converter take into account the different relation cascade action limitation of different RDBMS? *) Do DDL Template take into account the relation cascade action when generating SQL?

Thanks, Max

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 22-Sep-2006 12:36:51   

Max wrote:

I'm using LLBLGen 2 on VS 2005, adapter template. I need to support both MSAccess and SQL Server.

I'm getting some problem about relation cascade actions (delete cascade / update cascade).

I've converted my MSAccess based LLBL project to SQL Server. I've generated the DDL for SQL Server.

But running the DDL will generate many errors worrying about cyclic or multiple path cascade action. And the relations aren’t created disappointed I know that SQL Server is more restrictive about cyclic cascade action on relation, respect others RDBMS. I’ll need to speak about that with the DBA sunglasses

If multiple paths lead from table A to table B, cascades are hard to guarantee to work. SqlServer most of the time then gives up.

Now I've some question from the LLBLGen Pro viewpoint:

*) Do LLBLGen generated code rely on relation cascade action in the database?

No, it doesn't assume cascades are there. I.o.w.: you can work with the db as if there aren't cascades, so you've to execute the code in the right order.

If the answer is "no" then I can generate: - DBGeneric+DBSpecific code using Access LLBL Project - DBSpecific code for SQL Server using the converted project and everything shall run fine, even if the database have different cascade relation action. simple_smile

true, as you'll never run into them, unless you delete a PK entity first of course simple_smile

*) Do LLBLGen designer extract relation cascade action information from analyzed DB?

Yes, although not in all db's (as sometimes it's not retrievable), but it doesn't use that information.

If "yes" *) Do LLBLGen Project converter take into account the different relation cascade action limitation of different RDBMS?

No. It simply keeps them the same.

*) Do DDL Template take into account the relation cascade action when generating SQL?

Yes, but the cascades aren't converted.

Frans Bouma | Lead developer LLBLGen Pro
Max avatar
Max
User
Posts: 221
Joined: 14-Jul-2006
# Posted on: 22-Sep-2006 15:46:32   

Otis wrote:

....

Thanks, Max