public TransactionProxy(DtcIsolationLevel isoLevel, int timeout) { TransactionOptions options = new TransactionOptions { Timeout = TimeSpan.FromSeconds((double) timeout), IsolationLevel = ConvertIsolationLevelFromDtc(isoLevel) }; this.committableTx = new CommittableTransaction(options); this.systemTx = this.committableTx.Clone(); this.owned = false; }
public TransactionProxy(DtcIsolationLevel isoLevel, int timeout) { TransactionOptions options = new TransactionOptions { Timeout = TimeSpan.FromSeconds((double)timeout), IsolationLevel = ConvertIsolationLevelFromDtc(isoLevel) }; this.committableTx = new CommittableTransaction(options); this.systemTx = this.committableTx.Clone(); this.owned = false; }
internal static IsolationLevel ConvertIsolationLevelFromDtc(DtcIsolationLevel proxyIsolationLevel) { switch (proxyIsolationLevel) { case DtcIsolationLevel.ISOLATIONLEVEL_READUNCOMMITTED: return(IsolationLevel.ReadUncommitted); case DtcIsolationLevel.ISOLATIONLEVEL_CURSORSTABILITY: return(IsolationLevel.ReadCommitted); case DtcIsolationLevel.ISOLATIONLEVEL_REPEATABLEREAD: return(IsolationLevel.RepeatableRead); case DtcIsolationLevel.ISOLATIONLEVEL_SERIALIZABLE: return(IsolationLevel.Serializable); } return(IsolationLevel.Serializable); }
internal static IsolationLevel ConvertIsolationLevelFromDtc(DtcIsolationLevel proxyIsolationLevel) { switch (proxyIsolationLevel) { case DtcIsolationLevel.ISOLATIONLEVEL_READUNCOMMITTED: return IsolationLevel.ReadUncommitted; case DtcIsolationLevel.ISOLATIONLEVEL_CURSORSTABILITY: return IsolationLevel.ReadCommitted; case DtcIsolationLevel.ISOLATIONLEVEL_REPEATABLEREAD: return IsolationLevel.RepeatableRead; case DtcIsolationLevel.ISOLATIONLEVEL_SERIALIZABLE: return IsolationLevel.Serializable; } return IsolationLevel.Serializable; }