TxnAbort() private method

private TxnAbort ( IntPtr handle, int flags ) : int
handle System.IntPtr
flags int
return int
Exemplo n.º 1
0
 /// <summary>
 /// Aborts the Transaction if it has not already been committed or aborted.
 /// </summary>
 /// <remarks>
 /// This method wraps the native ups_txn_abort function.
 /// <br />
 /// Note that the function will fail with UPS_CURSOR_STILL_OPEN if
 /// a Cursor was attached to this Transaction, and the Cursor was
 /// not closed.
 /// </remarks>
 public void Abort()
 {
     if (env != null)
     {
         int st;
         lock (env) {
             st = NativeMethods.TxnAbort(handle, 0);
         }
         if (st != 0)
         {
             throw new DatabaseException(st);
         }
         handle = IntPtr.Zero;
         env    = null;
     }
 }