Adapter Transaction and Unit of Work

Posts   
 
    
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 09-Sep-2005 23:56:17   

Greetings, Is there a difference between using differen adapter data methods (like DeleteEntitiesDirectly, DeleteEntity and SaveEntity) using the same adapter object and inside a transaction; and doing the same operations using a UnitOfWork? Mainly, Does the unit-of-work do all its operations in one-go (one database trip) ?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 10-Sep-2005 02:48:54   

The major benefit of the UnitOfWork is that you do not have to begin a transaction on the database and perform locks when the task may take a long time due to waiting for resources or user input.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Sep-2005 12:36:55   

Some more info on the internal details to append on Brian's answer: The UoW acts the same internally as if you're calling the methods by hand, it doesn't batch statements in 1 statement/roundtrip.

Frans Bouma | Lead developer LLBLGen Pro