Hi all,

I have tried this question in the forum with no answer, so I decide to
give it a try here :)

I am using the "Using" statements in C# to handle the closing of SQLite
connection, transaction and command objects.  I have this setup in
different places in my code (Generic methods returning SQLite objects)
                  
using (IDbConnection conn = CreateConnection())
 {
   conn.Open();
   using (IDbTransaction transaction = conn.BeginTransaction())
        {
            Dosomething();
            transaction.Commit();
        }          
   } 

My question, what happens if there was an exception inside the
transaction using block? I know that the transaction object would be
closed and disposed, but does the traction roll back automatically by
the SQLite engine, or do I need to have special logic for that? What is
the suggested best practices in this case?
 
Cheers


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to