From: Martin Gainty Date: May 6 2011 12:24pm Subject: RE: DBCP error List-Archive: http://lists.mysql.com/mysql/224965 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_32463391-f901-45a4-a4d2-a5c1010f8563_" --_32463391-f901-45a4-a4d2-a5c1010f8563_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable connection leaks will occur because of code maladies did you check your code to ensure: you are closing Statement Handles when you have finished executing the stat= ement? you are closing Connection Handles when you have finished DML and DDL opera= tions with the Database? ? Martin=20 ______________________________________________=20 Verzicht und Vertraulichkeitanmerkung =20 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaeng= er sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiter= leitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient l= ediglich dem Austausch von Informationen und entfaltet keine rechtliche Bin= dungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen w= ir keine Haftung fuer den Inhalt uebernehmen. > Date: Fri=2C 6 May 2011 15:42:56 +0530 > Subject: Fwd: DBCP error > From: dhaval.jaiswal@stripped > To: mysql@stripped > CC: shrinivas.devarkonda@stripped >=20 > Hi All=2C >=20 > We are frequently getting DBCP error. We have seen this error in > catalina.log & apps log. This issue has started since last 2 -3 days. We > have checked the application code when this error has occured and assure > that there is no connection leakage in code. Mysql server is also running > fine. We have tune memory parameters in mysql=2C however effectless. Stil= l we > are getting the same error. >=20 > Any suggestion/solution would be appreciated. >=20 >=20 > Mysql server version: 5.0.45 >=20 > JDBC version: mysql-connector-java-5.1.5-bin.jar >=20 > apache Tomcat version: 6.0.16 >=20 >=20 > server.xml parameters are as follows:: >=20 >=20 > url=3D"jdbc:mysql://hostname:3306/dbname" username=3D"user" password=3D"= pass" > maxActive=3D"40" maxIdle=3D"20" maxWait=3D"5000" >=20 >=20 >=20 > ERROR: >=20 >=20 > 2011-05-05 16:32:57=2C666 [ajp-8009-177] ERROR TrainSearchResultCache.ja= va - > Error retrieving Train Search from DB: s- >=20 > org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection= =2C > pool error Timeout waiting for idle object >=20 > at > org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSo= urce.java:104) >=20 > at > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource= .java:880) >=20 > at > com.eos.gds.data.DatabaseManager.getConnection(DatabaseManager.java:73) >=20 > at > com.eos.gds.data.DatabaseManager.getConnection(DatabaseManager.java:60) >=20 > ............................................ >=20 > Caused by: java.util.NoSuchElementException: Timeout waiting for idle obj= ect >=20 > at > org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericOb= jectPool.java:958) >=20 > at > org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObj= ectPool.java:84) >=20 > at > org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSo= urce.java:96) >=20 > ... 28 more >=20 >=20 > com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications > link failure >=20 > Last packet sent to the server was 24 ms ago. >=20 > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) >=20 > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAc= cessorImpl.java:39) >=20 > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConst= ructorAccessorImpl.java:27) >=20 > at java.lang.reflect.Constructor.newInstance(Constructor.java:513= ) >=20 > at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) >=20 > at > com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) >=20 > at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2873) >=20 > at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2763) >=20 > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3299) >=20 > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837) >=20 > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961) >=20 > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543= ) >=20 > at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1= 737) >=20 > at > com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:202= 2) >=20 > at > com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:194= 0) >=20 > at > com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:192= 5) >=20 > at > org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(Del= egatingPreparedStatement.java:102) >=20 > at > com.eos.gds.cache.FareQuoteDBCache.storeItinQuotesIntoPresistentCache(Far= eQuoteDBCache.java:1029) >=20 > at > com.eos.gds.cache.FareQuoteDBCache.processInputQueue(FareQuoteDBCache.jav= a:899) >=20 > at > com.eos.gds.cache.FareQuoteDBCache.access$000(FareQuoteDBCache.java:37) >=20 > at > com.eos.gds.cache.FareQuoteDBCache$1.run(FareQuoteDBCache.java:103) >=20 > at java.lang.Thread.run(Thread.java:619) >=20 > Caused by: java.net.SocketException: Socket closed >=20 > at java.net.SocketInputStream.socketRead0(Native Method) >=20 > at java.net.SocketInputStream.read(SocketInputStream.java:129) >=20 > at > com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:1= 13) >=20 > at > com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecess= ary(ReadAheadInputStream.java:160) >=20 > at > com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:1= 88) >=20 > at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2329) >=20 > at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2774) >=20 >=20 >=20 >=20 > --=20 > Regards=2C > Dhaval Jaiswal >=20 >=20 >=20 >=20 > --=20 > Regards=2C > Dhaval Jaiswal = --_32463391-f901-45a4-a4d2-a5c1010f8563_--