public void Rollback(Enlistment enlistment) { try { ExecuteHelper.WithErrorTranslationAndProfiling(() => _transaction?.Rollback(), "VolatileResourceManager.Rollback", Logger); enlistment.Done(); } catch (Exception e) { Logger.Error( () => "Error attempting to rollback a transaction.", e); } finally { Dispose(); } }
public void Rollback(Enlistment enlistment) { try { // We don't need to roll back if we're in a read-only transaction, and indeed doing so will cause an error. if (_transaction != null && _transaction.Mode != TransactionMode.ReadOnly) { ExecuteHelper.WithErrorTranslationAndProfiling(() => _transaction.Rollback(), "VolatileResourceManager.Rollback", Logger); } enlistment.Done(); } catch (Exception e) { Logger.Error("Error attempting to rollback a transaction.", e); } finally { Dispose(); } }