in

System.Data.SQLite

An open-source, enhanced version of the SQLite database engine for Windows

Automatic Transaction Rollback on error?

Last post 04-25-2008 7:52 AM by diddleydoo. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-25-2008 3:57 AM

    Automatic Transaction Rollback on error?

    I'm having a slight problem understanding how to use nested Transactions......

    Whenever an error occurs in a nested transaction, the parent transaction seems to also be rolled back.  Trying to call a Rollback on this parent Transaction after an error (Caught with Catch (SQLiteException e) ) fails stating there is no transaction active....

    I have even taklen the care to ensure all Transaction names (within c#) are distinct. 

     Is this normal behaviour?

     Shane.

     PS the code works fine once there are no errors thrown in a nested transaction..... 

    PPS Never mind, I found what I was looking for. Remember: Search is your friend :) Transactions ARE rolled back automatically on errors within.  Kinda a need to know thing.... 

  • 04-25-2008 7:40 AM In reply to

    Re: Automatic Transaction Rollback on error?

    Yes.  Nested transactions in SQLite behave the same way they do in other applications such as Sql Server.  Issuing a rollback rolls back all of them.

     

  • 04-25-2008 7:52 AM In reply to

    Re: Automatic Transaction Rollback on error?

     Thanks for the reply...

    What I don't understand then is, what's the point of nested transactions at all?  If I don't have the choice to recover from an exception within a child transaction (don't know the proper terminology), then how does this actually differ from a single transaction?

    I'm getting a bit confused....

    Shane. 

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems