Application (1 test component) is using BoneCP connection pool. All the things are usually working fine (getting connection, releasing, ....) but sometimes in the random time happen that some connection is spontaneously closed.
This is the output from log4j:
-----------------------------------------------------------------------------------------------
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1205)
at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1197)
at com.mysql.jdbc.ConnectionImpl.createStatement(ConnectionImpl.java:2483)
at com.mysql.jdbc.ConnectionImpl.createStatement(ConnectionImpl.java:2465)
at com.radar.database.Connection.createStatement(Connection.java:218)
at com.jolbox.bonecp.ConnectionHandle.createStatement(ConnectionHandle.java:718)
at com.arbitrage.live.factor.FactorComponent.calculateOverallFactors(FactorComponent.java:181)
at com.arbitrage.live.factor.FactorComponent.access$1000(FactorComponent.java:28)
at com.arbitrage.live.factor.FactorComponent$ProcessMatches.run(FactorComponent.java:139)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
-----------------------------------------------------------------------------------------------
So I don't know if it is bug, or just some configuration issue about liveness of the connection.
Idle timeout is set to 60 seconds, min connections = 2, max connections = 5.
When the connection was closed, it was normally used by 1 thread of application, so it wasn't in the pool, so I think that it should not be closed spontaneously.
Thanks for reply.
Hi,
Can you post your full config please?