Example #1
0
		public static void InvokeTransacted (TransactedCallback callback, 
							TransactionOption mode, 
							ref bool transactionAborted)
		{
			// note: this is the documented exception for (Windows) OS prior to NT
			// so in this case we won't throw a NotImplementedException
			throw new PlatformNotSupportedException ("Not supported on mono");
		}
 public static void InvokeTransacted(TransactedCallback callback,
                                     TransactionOption mode,
                                     ref bool transactionAborted)
 {
     // note: this is the documented exception for (Windows) OS prior to NT
     // so in this case we won't throw a NotImplementedException
     throw new PlatformNotSupportedException("Not supported on mono");
 }
    /// <devdoc>
    ///    <para>[To be supplied.]</para>
    /// </devdoc>
    public static void InvokeTransacted(TransactedCallback callback, TransactionOption mode, ref bool transactionAborted) {
        // check for hosting permission even if no user code on the stack
        HttpRuntime.CheckAspNetHostingPermission(AspNetHostingPermissionLevel.Medium, SR.Transaction_not_supported_in_low_trust);

        bool executeWithoutTransaction = false;

#if !FEATURE_PAL // FEATURE_PAL does not enable Transactions
        if (Environment.OSVersion.Platform != PlatformID.Win32NT || Environment.OSVersion.Version.Major <= 4)
            throw new PlatformNotSupportedException(SR.GetString(SR.RequiresNT));
#else // !FEATURE_PAL
        throw new NotImplementedException("ROTORTODO");
#endif // !FEATURE_PAL


        if (mode == TransactionOption.Disabled)
            executeWithoutTransaction = true;

        if (executeWithoutTransaction) {
            // bypass the transaction logic
            callback();
            transactionAborted = false;
            return;
        }

        TransactedInvocation call = new TransactedInvocation(callback);
        TransactedExecCallback execCallback = new TransactedExecCallback(call.ExecuteTransactedCode);

        PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_PENDING);

        int rc;
        try {
            rc = UnsafeNativeMethods.TransactManagedCallback(execCallback, (int)mode);
        }
        finally {
            PerfCounters.DecrementCounter(AppPerfCounter.TRANSACTIONS_PENDING);
        }

        // rethrow the expection originally caught in managed code
        if (call.Error != null)
            throw new HttpException(null, call.Error); 

        PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_TOTAL);

        if (rc == 1) {
            PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_COMMITTED);
            transactionAborted = false;
        }
        else if (rc == 0) {
            PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_ABORTED);
            transactionAborted = true;
        }
        else {
            throw new HttpException(SR.GetString(SR.Cannot_execute_transacted_code));
        }
    }
Example #4
0
        public static void InvokeTransacted(TransactedCallback callback, TransactionOption mode, ref bool transactionAborted)
        {
            HttpRuntime.CheckAspNetHostingPermission(AspNetHostingPermissionLevel.Medium, "Transaction_not_supported_in_low_trust");
            bool flag = false;

            if ((Environment.OSVersion.Platform != PlatformID.Win32NT) || (Environment.OSVersion.Version.Major <= 4))
            {
                throw new PlatformNotSupportedException(System.Web.SR.GetString("RequiresNT"));
            }
            if (mode == TransactionOption.Disabled)
            {
                flag = true;
            }
            if (flag)
            {
                callback();
                transactionAborted = false;
            }
            else
            {
                int num;
                TransactedInvocation   invocation = new TransactedInvocation(callback);
                TransactedExecCallback callback2  = new TransactedExecCallback(invocation.ExecuteTransactedCode);
                PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_PENDING);
                try
                {
                    num = UnsafeNativeMethods.TransactManagedCallback(callback2, (int)mode);
                }
                finally
                {
                    PerfCounters.DecrementCounter(AppPerfCounter.TRANSACTIONS_PENDING);
                }
                if (invocation.Error != null)
                {
                    throw new HttpException(null, invocation.Error);
                }
                PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_TOTAL);
                switch (num)
                {
                case 1:
                    PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_COMMITTED);
                    transactionAborted = false;
                    return;

                case 0:
                    PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_ABORTED);
                    transactionAborted = true;
                    return;
                }
                throw new HttpException(System.Web.SR.GetString("Cannot_execute_transacted_code"));
            }
        }
        public static void InvokeTransacted(TransactedCallback callback, TransactionOption mode, ref bool transactionAborted)
        {
            HttpRuntime.CheckAspNetHostingPermission(AspNetHostingPermissionLevel.Medium, "Transaction_not_supported_in_low_trust");
            bool flag = false;
            if ((Environment.OSVersion.Platform != PlatformID.Win32NT) || (Environment.OSVersion.Version.Major <= 4))
            {
                throw new PlatformNotSupportedException(System.Web.SR.GetString("RequiresNT"));
            }
            if (mode == TransactionOption.Disabled)
            {
                flag = true;
            }
            if (flag)
            {
                callback();
                transactionAborted = false;
            }
            else
            {
                int num;
                TransactedInvocation invocation = new TransactedInvocation(callback);
                TransactedExecCallback callback2 = new TransactedExecCallback(invocation.ExecuteTransactedCode);
                PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_PENDING);
                try
                {
                    num = UnsafeNativeMethods.TransactManagedCallback(callback2, (int) mode);
                }
                finally
                {
                    PerfCounters.DecrementCounter(AppPerfCounter.TRANSACTIONS_PENDING);
                }
                if (invocation.Error != null)
                {
                    throw new HttpException(null, invocation.Error);
                }
                PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_TOTAL);
                switch (num)
                {
                    case 1:
                        PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_COMMITTED);
                        transactionAborted = false;
                        return;

                    case 0:
                        PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_ABORTED);
                        transactionAborted = true;
                        return;
                }
                throw new HttpException(System.Web.SR.GetString("Cannot_execute_transacted_code"));
            }
        }
 public static void InvokeTransacted(TransactedCallback callback, TransactionOption mode)
 {
     bool transactionAborted = false;
     InvokeTransacted(callback, mode, ref transactionAborted);
 }
 internal TransactedInvocation(TransactedCallback callback)
 {
     this._callback = callback;
 }
        public static void InvokeTransacted(TransactedCallback callback, TransactionOption mode)
        {
            bool abortedTransaction = false;

            InvokeTransacted(callback, mode, ref abortedTransaction);
        }
Example #9
0
 public static void InvokeTransacted(TransactedCallback callback, System.EnterpriseServices.TransactionOption mode, System.Boolean& transactionAborted)
 {
 }
Example #10
0
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public static void InvokeTransacted(TransactedCallback callback, TransactionOption mode, ref bool transactionAborted)
        {
            // check for hosting permission even if no user code on the stack
            HttpRuntime.CheckAspNetHostingPermission(AspNetHostingPermissionLevel.Medium, SR.Transaction_not_supported_in_low_trust);

            bool executeWithoutTransaction = false;

#if !FEATURE_PAL // FEATURE_PAL does not enable Transactions
            if (Environment.OSVersion.Platform != PlatformID.Win32NT || Environment.OSVersion.Version.Major <= 4)
            {
                throw new PlatformNotSupportedException(SR.GetString(SR.RequiresNT));
            }
#else // !FEATURE_PAL
            throw new NotImplementedException("ROTORTODO");
#endif // !FEATURE_PAL


            if (mode == TransactionOption.Disabled)
            {
                executeWithoutTransaction = true;
            }

            if (executeWithoutTransaction)
            {
                // bypass the transaction logic
                callback();
                transactionAborted = false;
                return;
            }

            TransactedInvocation   call         = new TransactedInvocation(callback);
            TransactedExecCallback execCallback = new TransactedExecCallback(call.ExecuteTransactedCode);

            PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_PENDING);

            int rc;
            try {
                rc = UnsafeNativeMethods.TransactManagedCallback(execCallback, (int)mode);
            }
            finally {
                PerfCounters.DecrementCounter(AppPerfCounter.TRANSACTIONS_PENDING);
            }

            // rethrow the expection originally caught in managed code
            if (call.Error != null)
            {
                throw new HttpException(null, call.Error);
            }

            PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_TOTAL);

            if (rc == 1)
            {
                PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_COMMITTED);
                transactionAborted = false;
            }
            else if (rc == 0)
            {
                PerfCounters.IncrementCounter(AppPerfCounter.TRANSACTIONS_ABORTED);
                transactionAborted = true;
            }
            else
            {
                throw new HttpException(SR.GetString(SR.Cannot_execute_transacted_code));
            }
        }
Example #11
0
 internal TransactedInvocation(TransactedCallback callback)
 {
     _callback = callback;
 }
 public static void InvokeTransacted(TransactedCallback callback, System.EnterpriseServices.TransactionOption mode, System.Boolean& transactionAborted)
 {
 }
 // Methods
 public static void InvokeTransacted(TransactedCallback callback, System.EnterpriseServices.TransactionOption mode)
 {
 }
 private void ProcessRequestTransacted()
 {
     bool transactionAborted = false;
     TransactedCallback callback = new TransactedCallback(this.ProcessRequestMain);
     Transactions.InvokeTransacted(callback, (TransactionOption) this._transactionMode, ref transactionAborted);
     try
     {
         if (transactionAborted)
         {
             this.OnAbortTransaction(EventArgs.Empty);
             WebBaseEvent.RaiseSystemEvent(this, 0x7d2);
         }
         else
         {
             this.OnCommitTransaction(EventArgs.Empty);
             WebBaseEvent.RaiseSystemEvent(this, 0x7d1);
         }
         this._request.ValidateRawUrl();
     }
     catch (ThreadAbortException)
     {
         throw;
     }
     catch (Exception exception)
     {
         PerfCounters.IncrementCounter(AppPerfCounter.ERRORS_DURING_REQUEST);
         PerfCounters.IncrementCounter(AppPerfCounter.ERRORS_TOTAL);
         if (!this.HandleError(exception))
         {
             throw;
         }
     }
 }
Example #15
0
        public static void InvokeTransacted(TransactedCallback callback, TransactionOption mode)
        {
            bool transactionAborted = false;

            InvokeTransacted(callback, mode, ref transactionAborted);
        }
		public static void InvokeTransacted (TransactedCallback callback, TransactionOption mode)
		{
			bool abortedTransaction = false;
			InvokeTransacted (callback, mode, ref abortedTransaction);
		}
		public static void InvokeTransacted (TransactedCallback callback, 
							TransactionOption mode, 
							ref bool transactionAborted)
		{
			throw new PlatformNotSupportedException ("Not supported on mono");
		}
Example #18
0
 public static void InvokeTransacted(TransactedCallback callback, System.EnterpriseServices.TransactionOption mode)
 {
 }