Log in


   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> UnitOfWork2.Commit Exceptions?

Pages: 1
Bugs & Issues
UnitOfWork2.Commit Exceptions?

  Print all messages in this thread  
Poster Message

Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
167 posts
# Posted on: 28-Mar-2009 11:46:30.  
I am looking into using UnitOfWork2 objects for the first time. I couldn't figure out how to determine what DB errors occur during a failed commit.

The reference documentation says that UnitOfWork2.Commit can throw only one type of exception: ArgumentNullException.

After reading a whole bunch of posts on this forum I've got a tentative conclusion that UnitOfWork2.Commit will, in fact, throw some ORM exceptions.

Is this a documentation bug? If so, what is the list of exceptions that I can expect UnitOfWork2.Commit() to throw?
LLBLGen Pro Team

The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
37860 posts
# Posted on: 28-Mar-2009 14:28:23.  
The documentation might be less optimal in this case, as is with most MSDN docs from ms: it doesnt always document all exceptions which could be thrown by code called by the class at hand, in this case unitofwork(2).

The unitofwork uses the same code for saving and deleting entities as the dataaccessadapter, so you can expect the same exceptions as from these methods, e.g. validation exceptions if validation fails, concurrency exceptions if updates didn't update a row, query construction exceptions if the entities to update /delete didn't have a pk defined, plus the queryexecution exception when the query in general fails (inside the db)

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
Pages: 1  

Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.