简体   繁体   中英

Java Play 2.2.2 BoneCp 0.8.0.RELEASE MySql Timeout Connection

I understand there are other posts that discussed this problem. I tried their solutions but none of them actually works.

I have been frustated and getting this error:

Caused by: java.sql.SQLException: Timed out waiting for a free available connection.
    at com.jolbox.bonecp.DefaultConnectionStrategy.getConnectionInternal(DefaultConnectionStrategy.java:88) ~[com.jolbox.bonecp-0.8.0.RELEASE.jar:na]
    at com.jolbox.bonecp.AbstractConnectionStrategy.getConnection(AbstractConnectionStrategy.java:90) ~[com.jolbox.bonecp-0.8.0.RELEASE.jar:na]

Also my bonecp configuration:

db.default.idleConnectionTestPeriod=10 minutes

db.default.maxConnectionsPerPartition=10
db.default.minConnectionsPerPartition=4

db.default.connectionTestStatement="SELECT 1"

Help would be much appreciated.

I had a similar problem which I tracked to returning data using QueryIterator. I changed my ebean logic to findList() and the problem went away. I'm guessing that my problem had something to do with resources not being released which in turn created the timeout issue.

I am using Play 2.2.3 with Java.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM