Article ID: 182036 - Last Review: May 2, 2006 - Revision: 4.1 HOWTO: Use MTS to Trap Error 'ASP 0113' Script Timed OutThis article was previously published under Q182036 SUMMARY
In a production environment, it is common to trap any errors that occur in your Active Server Pages (ASP) page by using the statement "On Error Resume Next." However, if a script time-out error occurs, it is not possible to trap that error by using this method because the ScriptTimeout is happening separately from the ASP error collection.
If, however, you make the ASP page transactional, you will be able to, in essence, handle the error. When the script time-out occurs, the transaction will have failed, and if you made any changes to a resource that supports transactions, such as Microsoft SQL Server, the changes will be rolled back. In addition, your ASP page can contain a procedure named OnTransactionAbort() that will execute when the transaction fails, even if the failure was due to a time-out or other error in that ASP page. The client will still receive the ASP 0113, but by using OnTransactionAbort, you have the ability to so something after the ScriptTimeout has occurred. MORE INFORMATION
Transactional ASP pages must be hosted on Internet Information Server 4.0
or higher. To make an ASP page transactional, the page must contain the
"TRANSACTION=required" argument in the @ Directives tag on the first line
of the page.
The following code sample demonstrates trapping the script time-out error: You can determine which event occurred in the IIS log files. If the script times out as a result of exceeding Server.ScriptTimeout, an "ASP 0113" will be reported to the client and logged in the Web logs. If the page is terminated because of a transaction timeout, an "HTTP 200" will be recorded in the Web log, indicating a success. Only by checking OnTransactionAbort will you see this failure. Also in MTS as part of Windows NT 4.0, transaction timeout is only configurable on a per-server level. This has been changed in COM+ (Windows 2000) so that transaction timeouts can be configured on a component level. For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base: 287499
(http://support.microsoft.com/kb/287499/EN-US/
)
HOWTO: Change the Transaction Timeout Value for MTS or COM+
253669
(http://support.microsoft.com/kb/253669/EN-US/
)
INFO: What's New with COM+ 1.0
REFERENCES
Additional samples of ASP functionality can be found in the Windows NT
Option Pack Documentation. This documentation is installed by default and
can be accessed from your Web server at the following location:
http://localhost/iishelp/iis/misc/default.asp
(http://localhost/iishelp/iis/misc/default.asp)
For the latest Knowledge Base articles and other support information on
Visual InterDev and Active Server Pages, see the following page on the
Microsoft Technical Support site:
http://support.microsoft.com/search/default.aspx?qu=vinterdev
(http://support.microsoft.com/search/default.aspx?qu=vinterdev)
APPLIES TO
| Article Translations
|
Back to the top
