Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
Exemplo n.º 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;
                }
            }
        }