The Engine.IgnoreExceptions property provides new approach to transactions management in V2. In V1 the Engine.Run method never raised any exceptions writing all exceptions to the logfile. Now you can set the IgnoreExceptions property to false and if any exception occurs in your interfaces implementation the Run method will throw an exception.
Often during a single call to Run method several method implementations are called by the Engine each updating your repository. To execute all methods in a single transaction you will usually set IgnoreExceptions property to false and start a transaction before calling Run method (or during the first update). If any update fails you will rollback the transaction in catch block:
engine.IgnoreExceptions = false;
Note that you do not need to log the exception in your catch block. The exception is logged by the Engine in Run method.
comments powered by