set maxIdleTime, maxIdleTimeExcessConnections of C3P0
Bug #602359 reported by
Archer
This bug report is a duplicate of:
Bug #540180: If the DB goes down at on point, even after the DB is up again all following request will fail.
Edit
Remove
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
play framework |
New
|
Undecided
|
Unassigned |
Bug Description
Because the default timeout of MySQL Connection is 8 hours, if a Play! application has been idle for over 8 hours, the instances of java.sql.Connection managed in C3P0 pool are out-of-date because they were closed by MySQL.
So we had better set the maxIdleTime and maxIdleExcessCo
Otherwise , we may need to restart the Play! application in a time.
tags: | added: c3p0 |
tags: | added: configuration database |
To post a comment you must log in.
Here is the error message :
play.exceptions .DatabaseExcept ion: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:
** BEGIN NESTED EXCEPTION **
com.mysql. jdbc.exceptions .jdbc4. CommunicationsE xception true' to avoid this problem.
MESSAGE: The last packet successfully received from the server was 45,024,887 milliseconds ago. The last packet sent successfully to the server was 45,024,888 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=
STACKTRACE:
com.mysql. jdbc.exceptions .jdbc4. CommunicationsE xception: The last packet successfully received from the server was 45,024,887 milliseconds ago. The last packet sent successfully to the server was 45,024,888 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect= true' to avoid this problem. jdbc.Util. handleNewInstan ce(Util. java:406) jdbc.SQLError. createCommunica tionsException( SQLError. java:1074) jdbc.MysqlIO. send(MysqlIO. java:3291) jdbc.MysqlIO. sendCommand( MysqlIO. java:1938) jdbc.MysqlIO. sqlQueryDirect( MysqlIO. java:2107) jdbc.Connection Impl.execSQL( ConnectionImpl. java:2642) jdbc.Connection Impl.execSQL( ConnectionImpl. java:2571) jdbc.StatementI mpl.executeQuer y(StatementImpl .java:1451) v2.c3p0. impl.NewProxySt atement. executeQuery( NewProxyStateme nt.java: 35) elggdb. ElggDB$ .executeQuery( ElggDB. scala:111) elggdb. ElggDB$ .initELGG_ META_ID( ElggDB. scala:43) elggdb. ElggDB$ .initElggDB( ElggDB. scala:38) elggdb. ElggDBPlugin. onApplicationSt art(ElggDBPlugi n.scala: 137) start(Play. java:386) detectChanges( Play.java: 493) Invocation. init(Invoker. java:98) SocketException : Connection reset by peer: socket write error SocketOutputStr eam.socketWrite 0(Native Method) SocketOutputStr eam.socketWrite (SocketOutputSt ream.java: 92) SocketOutputStr eam.write( SocketOutputStr eam.java: 136) BufferedOutputS tream.flushBuff er(BufferedOutp utStream. java:65) BufferedOutputS tream.flush( BufferedOutputS tream.java: 123) jdbc.MysqlIO. send(MysqlIO. java:3272)
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mchange.
at play.modules.
at play.modules.
at play.modules.
at play.modules.
at play.Play.
at play.Play.
at play.Invoker$
at Invocation.HTTP Request(Play!)
Caused by: java.net.
at java.net.
at java.net.
at java.net.
at java.io.
at java.io.
at com.mysql.
... 14 more
** END NESTED EXCEPTION **
at play.modules. elggdb. ElggDB$ .executeQuery( ElggDB. scala:114) elggdb. ElggDB$ .initELGG_ META_ID( ElggDB. scala:43) elggdb. ElggDB$ .initElggDB( ElggDB. scala:38) elggdb. ElggDBPlugin. onApplicationSt art(ElggDBPlugi n.scala: 137) start(Play. java:386) detectChanges( ...
at play.modules.
at play.modules.
at play.modules.
at play.Play.
at play.Play.