4

使用 BoneCp 0.7.1

我设置了我的应用程序,一切正常,但随后数据库脱机。

在下一个应用程序请求getConnection()开始引发内部异常并且重试机制启动但getConnection()从未返回而导致线程挂起。

下面的异常被一遍又一遍地抛出,但您希望getConnection()返回 NULL 或SQLException至少抛出一个,以便您可以处理它。

这似乎相似: http: //jolbox.com/forum/viewtopic.php ?t=339&p=1390但是我的问题是在建立连接后出现的。

也看到了这个... BoneCP 无法从断开的连接中恢复 我将尝试 8.0-rc1

10:03:58.302 [BoneCP-pool-watch-thread-com.xxx.xxxjdbc-28eb0780-683c-4fa8-92dc-57b2d071af2a] ERROR com.jolbox.bonecp.ConnectionHandle - Database access problem.
Killing off all remaining connections in the connection pool. SQL State = 08S01
10:03:58.318 [BoneCP-pool-watch-thread-com.xxx.xxxjdbc-28eb0780-683c-4fa8-92dc-57b2d071af2a] ERROR com.jolbox.bonecp.PoolWatchThread - Error in trying to obtain
a connection. Retrying in 500ms
java.sql.SQLException: Network error IOException: Connection refused: connect
at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:434) ~[jtds-1.3.0.jar:1.3.0]
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:183) ~[jtds-1.3.0.jar:1.3.0]
at java.sql.DriverManager.getConnection(DriverManager.java:579) ~[na:1.7.0_17]
at java.sql.DriverManager.getConnection(DriverManager.java:221) ~[na:1.7.0_17]
at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:256) ~[bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE]
at com.jolbox.bonecp.ConnectionHandle.obtainInternalConnection(ConnectionHandle.java:211) ~[bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE]
at com.jolbox.bonecp.ConnectionHandle.<init>(ConnectionHandle.java:170) ~[bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE]
at com.jolbox.bonecp.PoolWatchThread.fillConnections(PoolWatchThread.java:101) [bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE]
at com.jolbox.bonecp.PoolWatchThread.run(PoolWatchThread.java:82) [bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_17]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_17]
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_17]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_17]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_17]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_17]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) ~[na:1.7.0_17]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) ~[na:1.7.0_17]
at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_17]
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_17]
at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_17]
at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:300) ~[jtds-1.3.0.jar:1.3.0]
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:253) ~[jtds-1.3.0.jar:1.3.0]
at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:329) ~[jtds-1.3.0.jar:1.3.0]
... 11 common frames omitted

尝试 8.0-rc2 相同的问题 getConnection() 不会返回。

4

1 回答 1

0

老问题,但我可以建议尝试HikariCP以提高可恢复性。

于 2014-01-16T10:12:59.857 回答