2 // PreparingEnlistment.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
6 // Ankit Jain <JAnkit@novell.com>
14 using System.Threading;
16 namespace System.Transactions
18 public class PreparingEnlistment : Enlistment
20 bool prepared = false;
22 IEnlistmentNotification enlisted;
23 WaitHandle waitHandle;
26 internal PreparingEnlistment (Transaction tx, IEnlistmentNotification enlisted)
29 this.enlisted = enlisted;
30 waitHandle = new ManualResetEvent (false);
33 public void ForceRollback ()
39 public void ForceRollback (Exception ex)
41 tx.Rollback (ex, enlisted);
42 /* See test RMFail2 */
43 ((ManualResetEvent) waitHandle).Set ();
47 public void Prepared ()
50 /* See test RMFail2 */
51 ((ManualResetEvent) waitHandle).Set ();
55 public byte [] RecoveryInformation ()
57 throw new NotImplementedException ();
60 internal bool IsPrepared {
61 get { return prepared; }
64 internal WaitHandle WaitHandle {
65 get { return waitHandle; }
68 internal IEnlistmentNotification EnlistmentNotification
70 get { return enlisted; }
73 // Uncatched exceptions thrown during prepare will
74 // be saved here so they can be retrieved by TM.
75 internal Exception Exception