The procedure is in a package. When a procedure is called the client function got hanged. So they are asking to set a timeout for the API. Is it possible?
-
2AFAIK, it is possible to do in JDBC, for example. Anyway, the the best way is to implement this on the client-side. – Dmitriy Sep 06 '18 at 13:03
-
1No, you cannot set a timeout within the procedure. The call is synchronous. – OldProgrammer Sep 06 '18 at 14:09
-
I think you would be better advised to investigate why the called procedure is hanging and **fix that** . For starters, is it waiting on something? Or deadlocked? Or just written inefficiently? – APC Sep 07 '18 at 07:25
1 Answers
Not directly. However, I believe you should be able to accomplish what you are looking for, though I have never done it and do not have time to put together a proof of concept right now. Here is an outline of what you would need to do:
1) See this answer for a trick (kludge?) to get Oracle's resource manager to limit by execution time: https://stackoverflow.com/a/43532330/5174436
2) Modify the resource plan consumer group mapping to only apply to resource limit to a given MODULE_NAME
.
3) Set the given module name in your procedure via DBMS_APPLICATION_INFO.SET_MODULE
.
I offer no guarantees it will work. It is merely what I would try if I were faced with your need.
Actually, that is not true.. what I would really do if I were faced with your need is figure out why the procedure is "hanging" and fix it.

- 17,705
- 2
- 27
- 59