Comment 2 for bug 1109879

Revision history for this message
Robert Frey (rfrey74) wrote :

Hello,

I'm using BoneCP (0.8.0.RELEASE) as part of Play! 2.2.1, and I am having similar problems. My configuration is as follows:

db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://my-host/database-name"
db.default.user=user
db.default.password=password

The problem comes up after a period of idleness, and is intermittent. As you can see from the stacktrace below, the error occurs right after getting a connection. There is an attempt to set auto_commit, but it appears the connection the pool gave us was closed.

Thank you for your prompt attention to this issue.

@6g5hhg1nb: Execution exception in null:null
 at play.api.Application$class.handleError(Application.scala:293)
 at play.api.DefaultApplication.handleError(Application.scala:399)
 at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:165)
 at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:162)
 at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33)
 at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:185)
 at scala.util.Try$.apply(Try.scala:161)
 at scala.util.Failure.recover(Try.scala:185)
 at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:387)
 at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:387)
 at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
 at play.api.libs.iteratee.Execution$$anon$1.execute(Execution.scala:43)
 at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37)
 at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133)
 at scala.concurrent.Promise$class.complete(Promise.scala:55)
 at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58)
 at scala.concurrent.Future$$anonfun$flatMap$1$$anonfun$apply$3.apply(Future.scala:278)
 at scala.concurrent.Future$$anonfun$flatMap$1$$anonfun$apply$3.apply(Future.scala:278)
 at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
 at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.processBatch$1(Future.scala:731)
 at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply$mcV$sp(Future.scala:746)
 at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply(Future.scala:723)
 at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply(Future.scala:723)
 at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
 at scala.concurrent.Future$InternalCallbackExecutor$Batch.run(Future.scala:722)
 at scala.concurrent.Future$InternalCallbackExecutor$.scala$concurrent$Future$InternalCallbackExecutor$$unbatchedExecute(Future.scala:782)
 at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:773)
 at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37)
 at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133)
 at scala.concurrent.Promise$class.complete(Promise.scala:55)
 at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58)
 at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
 at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
 at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
 at play.api.libs.iteratee.Execution$$anon$2.execute(Execution.scala:70)
 at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37)
 at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133)
 at scala.concurrent.Promise$class.complete(Promise.scala:55)
 at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58)
 at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:23)
 at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
 at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
 at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
 at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
 at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
 at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
 at sun.reflect.GeneratedConstructorAccessor16.newInstance(Unknown Source)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
 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:1015)
 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
 at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1304)
 at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1296)
 at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5293)
 at com.jolbox.bonecp.ConnectionHandle.setAutoCommit(ConnectionHandle.java:1292)
 at play.api.db.BoneCPApi$$anon$1.onCheckOut(DB.scala:329)
 at com.jolbox.bonecp.AbstractConnectionStrategy.postConnection(AbstractConnectionStrategy.java:75)
 at com.jolbox.bonecp.AbstractConnectionStrategy.getConnection(AbstractConnectionStrategy.java:92)
 at com.jolbox.bonecp.BoneCP.getConnection(BoneCP.java:553)
 at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:131)
 at play.api.db.DBApi$class.getConnection(DB.scala:67)
 at play.api.db.BoneCPApi.getConnection(DB.scala:276)
 at play.api.db.DBApi$class.withConnection(DB.scala:80)
 at play.api.db.BoneCPApi.withConnection(DB.scala:276)
 at play.api.db.DB$$anonfun$withConnection$3.apply(DB.scala:162)
 at play.api.db.DB$$anonfun$withConnection$3.apply(DB.scala:162)
 at scala.Option.map(Option.scala:145)
 at play.api.db.DB$.withConnection(DB.scala:162)
 at models.Account$.getChildAccounts(Account.scala:160)