public DatabaseTransaction(IDbConnection connection)
        {
            if (_currentTransaction != null)
                return;

            _transaction = connection.BeginTransaction();
            _currentTransaction = this;
        }
示例#2
0
        public DatabaseTransaction(IDbConnection connection)
        {
            if (_currentTransaction != null)
            {
                return;
            }

            _transaction        = connection.BeginTransaction();
            _currentTransaction = this;
        }
示例#3
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (_transaction != null)
     {
         // if we are here, the Commit() was not called
         _transaction.Rollback();
         _transaction.Dispose();
     }
     if (_currentTransaction == this)
     {
         _currentTransaction = null;
     }
 }
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (_transaction != null)
     {
         // if we are here, the Commit() was not called
         _transaction.Rollback();
         _transaction.Dispose();
     }
     if (_currentTransaction == this)
         _currentTransaction = null;
 }