Jetty 9.2.3中是否存在JDBC ConnectionPool泄漏?

时间:2015-08-03 22:03:07

标签: java oracle jdbc jetty

我有一个长期运行的Java Jetty(版本9.2.3)应用程序与Oracle的数据库连接。该应用运行正常。但是,24小时后,我发现与Oracle服务器的TCP连接数增加了,并且大于我为ConnectionPool设置的MaxLimit(在我的例子中为4)。

$ netstat -an | grep 1234
tcp        0      0 ::ffff:10.178.120.15:60373  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp     2340      0 ::ffff:10.178.120.15:78482  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp     2440      0 ::ffff:10.178.120.15:88418  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp     2610      0 ::ffff:10.178.120.15:58264  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp        0      0 ::ffff:10.178.120.15:58288  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp        0      0 ::ffff:10.178.120.15:40352  ::ffff:218.17.10.11:1234   TIME_WAIT   
tcp        0      0 ::ffff:10.178.120.15:58145  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp     1230      0 ::ffff:10.178.120.15:59334  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp     2450      0 ::ffff:10.178.120.15:58287  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp     1230      0 ::ffff:10.178.120.15:59333  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp     1190      0 ::ffff:10.178.120.15:59340  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp     1320      0 ::ffff:10.178.120.15:58480  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp        0      0 ::ffff:10.178.120.15:40338  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp      100      0 ::ffff:10.178.120.15:59382  ::ffff:218.17.10.11:1234   ESTABLISHED 
tcp        0      0 ::ffff:10.178.120.15:40952  ::ffff:218.17.10.11:1234   TIME_WAIT   
tcp        0      0 ::ffff:10.178.120.15:70952  ::ffff:218.17.10.11:1234   TIME_WAIT   
tcp        0      0 ::ffff:10.178.120.15:60952  ::ffff:218.17.10.11:1234   TIME_WAIT   

Jetty 9.2.3中是否有ConnectionPool泄漏?

1 个答案:

答案 0 :(得分:2)

Jetty只跟踪(在JNDI中)并返回jdbc支持jar创建和维护的DataSource对象。

如果存在连接泄漏,那么它完全位于您正在使用的jdbc支持jar中。

查看该jar的更新,和/或考虑为您的DataSource使用正确的连接池层。

一些可能的候选人: