how to determine UnitOfWork.Commit failure?

Posts   
 
    
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 06-Nov-2006 19:15:42   

Using v2 final, Self Servicing, VS2005, C#

How do I determine if a UnitOfWork.Commit succeeds or fails? It doesn't return anything and the documentation doesn't mention any exceptions.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 06-Nov-2006 19:31:08   

Commit succeeds unless an exception occurs. Without an exception, the transaction will be committed, otherwise rolledback.

Frans Bouma | Lead developer LLBLGen Pro
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 06-Nov-2006 19:35:31   

Otis wrote:

Commit succeeds unless an exception occurs. Without an exception, the transaction will be committed, otherwise rolledback.

What's the specific transaction I should keep an eye out for?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 06-Nov-2006 20:32:01   

alexdresko wrote:

Otis wrote:

Commit succeeds unless an exception occurs. Without an exception, the transaction will be committed, otherwise rolledback.

What's the specific transaction I should keep an eye out for?

You mean exception? simple_smile

Any exception terminates the transaction. So ORMQueryExecutionException is the one which you will probably run into mostly. Also, ORMEntityValidationException and ORMConcurrencyException can be thrown.

Frans Bouma | Lead developer LLBLGen Pro
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 06-Nov-2006 20:39:09   

Otis wrote:

alexdresko wrote:

Otis wrote:

Commit succeeds unless an exception occurs. Without an exception, the transaction will be committed, otherwise rolledback.

What's the specific transaction I should keep an eye out for?

You mean exception? simple_smile

Any exception terminates the transaction. So ORMQueryExecutionException is the one which you will probably run into mostly. Also, ORMEntityValidationException and ORMConcurrencyException can be thrown.

Yes... funny thing is I was thinking EXCEPTION when I wrote transaction.. my fault..