Dispose() protected method

Disposes the transaction. If it is currently active, any changes are rolled back.
protected Dispose ( bool disposing ) : void
disposing bool
return void
Ejemplo n.º 1
0
        public bool TransactionCommit()
        {
            if (_SqlConnection.State != System.Data.ConnectionState.Open || _SqlCommand.Connection == null || _SqlTransaction == null)
            {
                throw new Exception("Connection or transaction not initialised");
            }

            try
            {
                _SqlTransaction.Commit();
            }
            catch (Exception ex)
            {
                LogFault("Transaction Commit failed.", ex, false);
            }

            _SqlCommand.Transaction = null;

            try
            {
                _SqlTransaction.Dispose();
            }
            catch
            {
            }
            _SqlTransaction = null;

            return(true);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     You have to hold the CoverMutex when calling this!
 /// </summary>
 private void _CommitCovers()
 {
     if (_TransactionCover == null)
     {
         return;
     }
     _TransactionCover.Commit();
     _TransactionCover.Dispose();
     _TransactionCover = null;
 }