So I am using Java Framework version 2.3.7, when I try to call a stored procedure It throws an exception: / P>
[ Error ] - There is an error in trying to load the gifts by the picture. The waiting for the free available connection ended Java.sql.SQLException: Timed out waiting for an available free connection com.jolbox.bonecp.DefaultConnectionStrategy.getConnectionInternal (DefaultConnectionStrategy.java:88) ~ [bonecp-0.8.0.RELEASE.jar: na] on com.jolbox.bonecp on .AbstractConnectionStrategy.getConnection (AbstractConnectionStrategy.java:90) ~ [bonecp-0.8.0.RELEASE.jar: na] on com.jolbox.bonecp.BoneCP.getConnection (BoneCP.java:553) ~ [bonecp-0.8.0 .RELEASE.jar: na] at com.jolbox.bonecp BoneCPDataSource.getConnection (BoneCPDataSource.java:131) ~ [bonecp-0.8.0.RELEASE.jar: na] - play.api.db.DBApi $ class.getConnection (DB.scala: 66) on ~ [Play-jdbc_2. 11-2.3.7.jr: 2.3.7]
Java code:
callable format cst = null; Results set rs = null; Connection Conn = DB.getConnection (); & Lt; Picture & gt; Picture = null; Try {conn = db.getConnection (); (Gift gift: giftList) {CST = conn.prepareCall ("? {Sp_set_pictures_LOAD_PICTURES_BY_GIFT ()} call"); Cst.setInt (1, gift.getID); Rs = cst.executeQuery (); If (rs.next ()) {Pictures = new array list & lt; Picture & gt; (); Do {Picture p = New Picture (rs.getInt (1)); Pictures.add (p); } While (rsnext ()); Gift.setPictures (pictures); }}} Hold (exception e) {logger Terror ("There has been an error trying to load the picture by gift. \ N" + e.getMessage (), e); } Finally {if (CST! = Null) CST = Faucet; Conn; }
application.conf:
db.default.autocommit = true db.default.isolation = READ_COMMITTED db.default . Partition number = 2 db.default.maxConnectionsPerPartition = 5 db.default.minConnectionsPerPartition = 5 db.default.acquireIncrement = 1 db.default.acquireRetryAttempts = 10 db.default.acquireRetryDelay = 5 seconds db.default.connectionTimeout = 20 sec DB default.idleMaxAge = 10 minutes Select db.default.idleConnectionTestPeriod = 5 minutes db.default.initSQL = "1" db.default.logStatements = false db.default.maxConnectionAge = 1 hour db.default.queryExecuteTimeLimit = 1 second < / Code> You call DB.getConnection ()
twice, perhaps because of this, the JDBC driver makes 2 connections, But you only turn off the other.
No comments:
Post a Comment