Oracle的JDBC查询超时是如何实现的? [英] How is Oracle's JDBC query timeout implemented?

查看:131
本文介绍了Oracle的JDBC查询超时是如何实现的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇Oralce JDBC瘦客户端如何实现查询超时。
这可以通过调用java.sql.Statement的setQueryTimeout(int seconds)
方法来设置。

I was curious as to how the Oralce JDBC thin client implement query timeout. This can be set by calling java.sql.Statement's setQueryTimeout(int seconds) method.

这是在驱动程序本身上实现的吗?客户端?是一个
新线程产生并加入?或者JDBC驱动程序只是
向Oracle发送参数,然后它强制执行超时?

Is this implemented in the driver itself on the client side? Is a new thread spawned and joined? Or does the JDBC driver simply send a parameter to Oracle, and then it enforces the timeout?

达到超时后,客户端上的资源和
数据库被发布了,哪个挂了?即使客户端放弃了查询还是
终止,Oracle是否继续运行查询
?客户端是否还有游标对象?

After the timeout is reached, which resources on the client and database are released, and which hang around? Does Oracle continue to run the query even though the client abandoned it or is it terminated? Is there still a cursor object on the client side?

谢谢

推荐答案

Tanel Poder写了文章
我想类似的事情是针对JDBC完成的。如果您使用厚驱动程序,通过OCI,您可以尝试跟踪会话(通过设置sqlnet.ora)并查看记录的内容。

Tanel Poder wrote an article on how a Cancel works through the OCI (Oracle Call Interface). I guess something similar is done for JDBC. If you are using the thick driver, through OCI, you could try tracing the session (through settings sqlnet.ora) and see what gets recorded.

这篇关于Oracle的JDBC查询超时是如何实现的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆