Oracle - OCI 查询超时
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/756137/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle - OCI query timeout
提问by Dmitry Khalatov
Is there any way to set a timeout on Oracle OCI calls (OCIStmtExecute for example) ?
有没有办法在 Oracle OCI 调用(例如 OCIStmtExecute)上设置超时?
Thanks
谢谢
回答by Quassnoi
There is no way provided by OCI
itself.
没有办法OCI
自己提供。
You can create a Timer
and issue an OCIBreak()
on timeout.
您可以创建一个Timer
并OCIBreak()
在超时时发出一个。
OCIBreak()
is thread safe and signal safe.
OCIBreak()
是线程安全和信号安全的。
回答by user199543
Timeouts can be set on oracle server side, but not through any OCI APIs.
可以在 oracle 服务器端设置超时,但不能通过任何 OCI API。
回答by AXE Labs
PHP's OCI module can do it according to this comment:
PHP的OCI模块可以根据这个注释来做: