Alter UTL_HTTP Timeout [message #250829] |
Wed, 11 July 2007 08:23 |
amardilo
Messages: 37 Registered: February 2007
|
Member |
|
|
Hi there.
Is there a way to get PL/SQL code to notice when a UTL_HTTP request times out?
I would like my code to spot the time out then increase the UTL_HTTP request time out period by 5 seconds. Once a request has been received to then revert the timeout back to the default 60 seconds.
Due to a restriction I am not allowed to increase the UTL_HTTP timeout permanently.
The UTL_HTTP package is used in many areas and I only need this (increase and decrease) functionality to run in one area.
Any help or advice would be very useful (even if I am not this is not possible).
|
|
|
Re: Alter UTL_HTTP Timeout [message #251791 is a reply to message #250829] |
Mon, 16 July 2007 12:13 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
a common approach to this type of issue (similar to locks) would be to put the request in a loop and try 3 times or so before failing for the particular error code you have trying to make it more robust for.
If you do a "descr utl_http" from sqlplus, you can set the timeout as your session level - it's not a global change for other users of utl_http.
SQL> descr utl_http;
.
.
.
/**
* Sets the default time-out value for all future HTTP requests that the
* UTL_HTTP package should attempt reading the HTTP response from the
* Web server or proxy server. This time-out value may be used to avoid the
* PL/SQL programs from being blocked by busy Web servers or heavy network
* traffic while retrieving Web pages from the Web servers. The default
* value of the time-out is 60 seconds.
*
* PARAMETERS
* timeout The network transfer time-out value (in seconds).
*
* EXCEPTIONS
* miscellaneous runtime exceptions.
* NOTES
* None.
*/
PROCEDURE set_transfer_timeout(timeout IN PLS_INTEGER DEFAULT 60);
PRAGMA restrict_references(set_transfer_timeout, wnds, rnds, trust);
/**
* Retrieves the default time-out value for all future HTTP requests.
*
* PARAMETERS
* timeout The network transfer time-out value (in seconds).
*
* EXCEPTIONS
* miscellaneous runtime exceptions.
* NOTES
* None.
*/
PROCEDURE get_transfer_timeout(timeout OUT PLS_INTEGER);
PRAGMA restrict_references(get_transfer_timeout, wnds, rnds, trust);
.
.
.
|
|
|