Passing adapter accross projects

Posts   
 
    
lotek
User
Posts: 56
Joined: 14-Sep-2005
# Posted on: 18-Aug-2009 20:03:16   

We have two seperate llblgen projects and want to execute code in both project under a single transaction. Typically, we would pass the adapter between calls but in this case the other project is expecting a different type and does not accept the adapter. What is the best practice in this situation?

Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 18-Aug-2009 20:56:28   

Have you tried passing an IDataAccessAdapter rather than the Adapter itself?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 18-Aug-2009 21:37:37   

What he said...simple_smile

lotek
User
Posts: 56
Joined: 14-Sep-2005
# Posted on: 18-Aug-2009 22:15:26   

What is the project have different entity definitions?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 18-Aug-2009 23:14:33   

Take a look at this thread which discusses this issue.

The documentation for multiple database transactions is here

Matt

lotek
User
Posts: 56
Joined: 14-Sep-2005
# Posted on: 19-Aug-2009 00:45:41   

Humm, anything without using a distributed transaction? I would like to reuse a connection so that the transaction doesn't get escalated.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Aug-2009 07:28:22   

In my opinion, Enterprise Services is the way to go. Anyway, check this related post: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=4670&StartAtMessage=0&#25336

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Aug-2009 10:41:45   

Or if you're on .NET 2.x or newer, you could also try System.Transactions.TransactionScope (which under the hood uses MS DTS).

Frans Bouma | Lead developer LLBLGen Pro