예제 #1
0
        internal OletxEnlistment ReenlistTransaction(Guid resourceManagerIdentifier, byte[] recoveryInformation, IEnlistmentNotificationInternal enlistmentNotification)
        {
            if (recoveryInformation == null)
            {
                throw new ArgumentNullException("recoveryInformation");
            }
            if (enlistmentNotification == null)
            {
                throw new ArgumentNullException("enlistmentNotification");
            }
            OletxResourceManager manager = this.RegisterResourceManager(resourceManagerIdentifier);

            if (manager == null)
            {
                throw new ArgumentException(System.Transactions.SR.GetString("InvalidArgument"), "resourceManagerIdentifier");
            }
            if (manager.RecoveryCompleteCalledByApplication)
            {
                throw new InvalidOperationException(System.Transactions.SR.GetString("ReenlistAfterRecoveryComplete"));
            }
            return(manager.Reenlist(recoveryInformation.Length, recoveryInformation, enlistmentNotification));
        }
예제 #2
0
        internal OletxEnlistment ReenlistTransaction(
            Guid resourceManagerIdentifier,
            byte[] recoveryInformation,
            IEnlistmentNotificationInternal enlistmentNotification
            )
        {
            if (null == recoveryInformation)
            {
                throw new ArgumentNullException("recoveryInformation");
            }

            if (null == enlistmentNotification)
            {
                throw new ArgumentNullException("enlistmentNotification");
            }

            // Now go find the resource manager in the collection.
            OletxResourceManager oletxResourceManager = RegisterResourceManager(resourceManagerIdentifier);

            if (null == oletxResourceManager)
            {
                throw new ArgumentException(SR.GetString(SR.InvalidArgument), "resourceManagerIdentifier");
            }

            if (oletxResourceManager.RecoveryCompleteCalledByApplication)
            {
                throw new InvalidOperationException(SR.GetString(SR.ReenlistAfterRecoveryComplete));
            }

            // Now ask the resource manager to reenlist.
            OletxEnlistment returnValue = oletxResourceManager.Reenlist(
                recoveryInformation.Length,
                recoveryInformation,
                enlistmentNotification
                );


            return(returnValue);
        }