My OnTransactionCommit method is not being called on IIS 7 when I use Response.Redirect or Response.End. The code below works as expected on IIS 6 ("Comitting..." is output after "OK") but on IIS 7 I only get "OK" unless I remove the Response.End. The OnTransactionAbort method is called on both versions of IIS if I replace Response.End with Err.Raise.
I have tried changing the pipeline to Classic but that had no effect. Can anyone shed any light on what setting I need to change to get this method to execute?
<%@ Transaction="Supported" Language="VBScript" %>
<% Option Explicit %>
<%
'Called by context unless transaction is aborted
Sub OnTransactionCommit()
Response.Write("Commiting...")
Response.Flush
End Sub
'Called by context when transaction is aborted
Sub OnTransactionAbort()
Response.Write("Aborting...")
Response.Flush
End Sub
Response.Write("OK<br/>")
Response.Flush
Response.End
'Err.Raise 1, "test"
%>
Calling Response.End
or Response.Redirect
probably throws a ThreadAbortedException
, as calling it in .NET
does (IIS7 and .NET are tightly integrated).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With