コード例 #1
0
 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();
     }
 }
コード例 #2
0
 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();
     }
 }