Transaction now has limited support for PromotableSinglePhaseEnlistment
[mono.git] / mcs / class / System.Transactions / System.Transactions / SinglePhaseEnlistment.cs
index a386a6967e2bcd1ecc0b9b475fe02f502a325ac5..072c3e99710ca41fd454c65b756653b775eaf49b 100644 (file)
@@ -17,12 +17,18 @@ namespace System.Transactions
        {
 //             bool committed;
                Transaction tx;
-               ISinglePhaseNotification enlisted;
+               object abortingEnlisted;
                
-               internal SinglePhaseEnlistment (Transaction tx, ISinglePhaseNotification enlisted)
+               /// <summary>
+               /// The empty ctor is used only for enlistments passed to resource managers when rolling back a transaction that
+               ///  has already been aborted by another resource manager; no need to retrigger (another) rollback.
+               /// </summary>
+               internal SinglePhaseEnlistment () {}
+
+               internal SinglePhaseEnlistment (Transaction tx, object abortingEnlisted)
                {
                        this.tx = tx;
-                       this.enlisted = enlisted;
+                       this.abortingEnlisted = abortingEnlisted;
                }
 
                public void Aborted ()
@@ -32,7 +38,8 @@ namespace System.Transactions
 
                public void Aborted (Exception e)
                {
-                       tx.Rollback (e, enlisted);
+                       if (tx != null)
+                               tx.Rollback (e, abortingEnlisted);
                }
 
                [MonoTODO]