NLite.Data.TransactionWrapper.Rollback C# (CSharp) Method

Rollback() public method

public Rollback ( ) : void
return void
        public override void Rollback()
        {
            transactionCount = 0;
            Inner.Rollback();
            Connection.transaction = null;
            Inner.Dispose();
            Inner = null;
            WasRolledBack = true;
        }

Usage Example

Example #1
0
        protected virtual void DisposeTransaction()
        {
            if (transaction != null && !transaction.WasCommitted && !transaction.WasRolledBack)
            {
                try
                {
                    transaction.Commit();
                }
                catch
                {
                    try
                    {
                        transaction.Rollback();
                    }
                    catch
                    {
                    }
#if DEBUG
                    throw;
#endif
                }
                finally
                {
                    transaction.Dispose();
                    transaction = null;
                }
            }
        }