英文:
With Oracle JDBC driver seeing extra connection doing SELECT SYS_CONTEXT Query
问题
无法找到Oracle文档提及有关此查询从连接引起的原因。使用JDBC驱动程序ojdbc7-12.1.0.2.jar。
我们注意到有一个连接在短时间内运行了以下操作
SELECT SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') FROM DUAL
在代码中
connection = provider.getConnection();
connection.setNetworkTimeout(Executors.newSingleThreadExecutor(), network_timeout);
英文:
Unable to find Oracle documents referring to the cause for this Query from Connection. Using the JDBC Driver ojdbc7-12.1.0.2.jar
We saw that there was one connection for brief time running
SELECT SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') FROM DUAL
In Code
connection = provider.getConnection();
connection.setNetworkTimeout(Executors.newSingleThreadExecutor(), network_timeout);
答案1
得分: 1
以下是翻译好的内容:
Oracle JDBC驱动程序在连接池中定义了n个连接作为最大连接数时,将打开max(n+1)个连接。其中的1个是用于管理池中的管理会话。
英文:
The Oracle JDBC Driver opens max(n+1) connections if n connections are defined as maximum number of connections in connection pool. The 1 is a administrative session handling the pool.
答案2
得分: 0
甲骨文JDBC驱动程序在连接池中将最多打开max(n+1)个连接,如果n个连接被定义为连接池中的最大连接数。其中的1是处理池的管理会话。
这不仅是JDBC的行为,也出现在甲骨文.NET提供程序和OCI中——据我所记得。
英文:
The Oracle JDBC Driver opens max(n+1) connections if n connections are defined as maximum number of connections in connection pool. The 1 is a administrative session handling the pool.
This is not a JDBC only behaviour but seen in Oracle .NET provider and OCI, too - as far I can remember
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论