[Serializable]
public class Transaction : IDisposable, ISerializable
{
+ [ThreadStatic]
static Transaction ambient;
IsolationLevel level;
}
}
- [MonoTODO]
public Transaction Clone ()
{
return new Transaction (this);
}
- [MonoTODO]
public void Dispose ()
{
- throw new NotImplementedException ();
+ if (TransactionInformation.Status == TransactionStatus.Active)
+ Rollback();
}
[MonoTODO]
return d;
}
- [MonoTODO]
+ [MonoTODO ("Only SinglePhase commit supported for durable resource managers.")]
[PermissionSetAttribute (SecurityAction.LinkDemand)]
public Enlistment EnlistDurable (Guid manager,
IEnlistmentNotification notification,
throw new NotImplementedException ("Only SinglePhase commit supported for durable resource managers.");
}
- [MonoTODO]
+ [MonoTODO ("Only Local Transaction Manager supported. Cannot have more than 1 durable resource per transaction. Only EnlistmentOptions.None supported yet.")]
[PermissionSetAttribute (SecurityAction.LinkDemand)]
public Enlistment EnlistDurable (Guid manager,
ISinglePhaseNotification notification,
throw new NotImplementedException ();
}
- [MonoTODO]
+ [MonoTODO ("EnlistmentOptions being ignored")]
public Enlistment EnlistVolatile (
IEnlistmentNotification notification,
EnlistmentOptions options)
return EnlistVolatileInternal (notification, options);
}
- [MonoTODO]
+ [MonoTODO ("EnlistmentOptions being ignored")]
public Enlistment EnlistVolatile (
ISinglePhaseNotification notification,
EnlistmentOptions options)
/* FIXME: Enlistment.. ? */
return new Enlistment ();
}
-
- [MonoTODO]
+
public override bool Equals (object obj)
{
- Transaction t = obj as Transaction;
- if (t == null)
+ return Equals (obj as Transaction);
+ }
+
+ // FIXME: Check whether this is correct (currently, GetHashCode() uses 'dependents' but this doesn't)
+ private bool Equals (Transaction t)
+ {
+ if (ReferenceEquals (t, this))
+ return true;
+ if (ReferenceEquals (t, null))
return false;
return this.level == t.level &&
this.info == t.info;
}
- [MonoTODO]
- public static bool op_Inequality (Transaction x, Transaction y)
+ public static bool operator == (Transaction x, Transaction y)
{
- if (x == null && y == null)
- return false;
- if (x == null || y == null)
- return true;
+ if (ReferenceEquals (x, null))
+ return ReferenceEquals (y, null);
+ return x.Equals (y);
+ }
- return ! x.Equals (y);
+ public static bool operator != (Transaction x, Transaction y)
+ {
+ return !(x == y);
}
public override int GetHashCode ()