Hello,
I am fairly new to ASP programming (one year experiance) and I have a problem that I need to resolve.
I need to be able to gracefully handle a Script Timeout, but I do not know how. Increasing the Timeout time is NOT an option. I am doing some complex searches on huge databases and if the user puts in some search criteria that is too vague, it is possible for the search to take over 180 seconds. That is not acceptable to our management team, all scripts should run under 60 seconds. SO...what I want to be able to do, is to send the user to an error page that tells them that their search is too broad and that they need to narrow their search to get some results, but right now all they get is a Script Timeout error.
I found a tip on the Microsoft website that says to include TRANSACTION=Required in the @ directive at the top of the page. Then, use the Sub OnTransactionAbort() to redirect the user to an error page. This works fine on a small test script I wrote, but on the real life code, it fails at the database connection line with a Distributed Transaction Error.
2 questions:
1) is there any easy way to capture a Script Timeout and redirect gracefully?
2) any ideas on now I may be able to get the MTS version to work? I am an MTS virgin and know almost nothing about it, so hopefully I am nopt in over my head.
Thanks,
-Greg
I am fairly new to ASP programming (one year experiance) and I have a problem that I need to resolve.
I need to be able to gracefully handle a Script Timeout, but I do not know how. Increasing the Timeout time is NOT an option. I am doing some complex searches on huge databases and if the user puts in some search criteria that is too vague, it is possible for the search to take over 180 seconds. That is not acceptable to our management team, all scripts should run under 60 seconds. SO...what I want to be able to do, is to send the user to an error page that tells them that their search is too broad and that they need to narrow their search to get some results, but right now all they get is a Script Timeout error.
I found a tip on the Microsoft website that says to include TRANSACTION=Required in the @ directive at the top of the page. Then, use the Sub OnTransactionAbort() to redirect the user to an error page. This works fine on a small test script I wrote, but on the real life code, it fails at the database connection line with a Distributed Transaction Error.
2 questions:
1) is there any easy way to capture a Script Timeout and redirect gracefully?
2) any ideas on now I may be able to get the MTS version to work? I am an MTS virgin and know almost nothing about it, so hopefully I am nopt in over my head.
Thanks,
-Greg