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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 18:04:27  来源:igfitidea点击:

Oracle - OCI query timeout

oracletimeoutprepared-statementoci

提问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 OCIitself.

没有办法OCI自己提供。

You can create a Timerand issue an OCIBreak()on timeout.

您可以创建一个TimerOCIBreak()在超时时发出一个。

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模块可以根据这个注释来做:

http://www.php.net/manual/en/function.oci-connect.php#84144

http://www.php.net/manual/en/function.oci-connect.php#84144