private void Enlist(string userName, string password, string serverName, System.Transactions.Transaction transaction, bool manualEnlistment) { this.UnEnlist(); if (!OCI.ClientVersionAtLeastOracle9i) { throw System.Data.Common.ADP.DistribTxRequiresOracle9i(); } if (null != transaction) { if (this.HasTransaction) { throw System.Data.Common.ADP.TransactionPresent(); } byte[] buffer3 = this.StringToNullTerminatedBytes(password); byte[] buffer2 = this.StringToNullTerminatedBytes(userName); byte[] buffer = this.StringToNullTerminatedBytes(serverName); this._enlistContext = new OciEnlistContext(buffer2, buffer3, buffer, this.ServiceContextHandle, this.ErrorHandle); this._enlistContext.Join(this, transaction); this.TransactionState = System.Data.OracleClient.TransactionState.GlobalStarted; } else { this.TransactionState = System.Data.OracleClient.TransactionState.AutoCommit; } base.EnlistedTransaction = transaction; }
internal static void SafeDispose(ref OciEnlistContext ociEnlistContext) { if (ociEnlistContext != null) { ociEnlistContext.Dispose(); } ociEnlistContext = null; }
private void UnEnlist() { if (this._enlistContext != null) { this.TransactionState = System.Data.OracleClient.TransactionState.AutoCommit; this._enlistContext.Join(this, null); OciEnlistContext.SafeDispose(ref this._enlistContext); this.Transaction = null; } }
internal static void SafeDispose(ref OciEnlistContext ociEnlistContext) { // Safely disposes of the handle (even if it is already null) and // then nulls it out. if (null != ociEnlistContext) { ociEnlistContext.Dispose(); } ociEnlistContext = null; }
internal static int OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans) { if (Bid.AdvancedOn) { Bid.Trace("<oc.OraMTSJoinTxn|ADV|OCI> pCtxt=0x%-07Ix pTrans=...\n", OciEnlistContext.HandleValueToTrace(pCtxt)); } int num = System.Data.Common.UnsafeNativeMethods.OraMTSJoinTxn(pCtxt, pTrans); if (Bid.AdvancedOn) { Bid.Trace("<oc.OraMTSJoinTxn|ADV|OCI|RET> rc=%d\n", num); } return(num); }
public override void Dispose() { this.Deactivate(); OciEnlistContext.SafeDispose(ref this._enlistContext); OciHandle.SafeDispose(ref this._sessionHandle); OciHandle.SafeDispose(ref this._serviceContextHandle); OciHandle.SafeDispose(ref this._serverHandle); OciHandle.SafeDispose(ref this._errorHandle); OciHandle.SafeDispose(ref this._environmentHandle); if (this._scratchBuffer != null) { this._scratchBuffer.Dispose(); } this._scratchBuffer = null; this._encodingDatabase = null; this._encodingNational = null; this._transaction = null; this._serverVersionString = null; base.Dispose(); }
internal static int OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans) { if (Bid.AdvancedOn) { Bid.Trace("<oc.OraMTSJoinTxn|ADV|OCI> pCtxt=0x%-07Ix pTrans=...\n", OciEnlistContext.HandleValueToTrace(pCtxt)); } int num = System.Data.Common.UnsafeNativeMethods.OraMTSJoinTxn(pCtxt, pTrans); if (Bid.AdvancedOn) { Bid.Trace("<oc.OraMTSJoinTxn|ADV|OCI|RET> rc=%d\n", num); } return num; }
internal static IntPtr HandleValueToTrace(OciEnlistContext handle) { return(handle.DangerousGetHandle()); }
internal static IntPtr HandleValueToTrace(OciEnlistContext handle) { return handle.DangerousGetHandle(); }
internal static extern int OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans);