public override DbTransaction BeginTransaction(IsolationLevel isolevel)
 {
     // Take the transaction lock before beginning the
     // transaction to avoid a deadlock
     AssertThreadOwner();
     transactionLock.OpenWriter();
     return(new SQLExtTransaction <TConn>(connection.BeginTransaction(isolevel), transactionLock));
 }
Exemplo n.º 2
0
 public override int ExecuteNonQuery()
 {
     if (transaction != null)
     {
         try
         {
             transaction.BeginCommand(this);
             return(InnerCommand.ExecuteNonQuery());
         }
         finally
         {
             transaction.EndCommand();
         }
     }
     else
     {
         try
         {
             txnlock.OpenWriter();
             txnlock.BeginCommand(this);
             return(InnerCommand.ExecuteNonQuery());
         }
         finally
         {
             txnlock.EndCommand();
             txnlock.CloseWriter();
         }
     }
 }