List:General Discussion« Previous MessageNext Message »
From:Dhaval Jaiswal Date:June 1 2011 2:05pm
Subject:Re: DBCP error
View as plain text  
Hi Martin,

We have modified all timeout,buffersize,pool related parameters from mysql
server side. However, still we are getting DBCP errors.

We have practice to close the database connection in finally block of java ,
in the std practice order of resultset to conn.close..
What would be other things to check and fix these errors?




On Fri, May 6, 2011 at 5:54 PM, Martin Gainty <mgainty@stripped> wrote:

>  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
> statement?
> you are closing Connection Handles when you have finished DML and DDL
> operations with the Database?
> ?
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung
>
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
>
>
>
>
> > Date: Fri, 6 May 2011 15:42:56 +0530
> > Subject: Fwd: DBCP error
> > From: dhaval.jaiswal@stripped
> > To: mysql@stripped
> > CC: shrinivas.devarkonda@stripped
>
> >
> > Hi All,
> >
> > 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, however effectless. Still
> we
> > are getting the same error.
> >
> > Any suggestion/solution would be appreciated.
> >
> >
> > Mysql server version: 5.0.45
> >
> > JDBC version: mysql-connector-java-5.1.5-bin.jar
> >
> > apache Tomcat version: 6.0.16
> >
> >
> > server.xml parameters are as follows::
> >
> >
> > url="jdbc:mysql://hostname:3306/dbname" username="user" password="pass"
> > maxActive="40" maxIdle="20" maxWait="5000"
> >
> >
> >
> > ERROR:
> >
> >
> > 2011-05-05 16:32:57,666 [ajp-8009-177] ERROR TrainSearchResultCache.java
> -
> > Error retrieving Train Search from DB: s-
> >
> > org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection,
> > pool error Timeout waiting for idle object
> >
> > at
> >
>
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)
> >
> > at
> >
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
> >
> > at
> > com.eos.gds.data.DatabaseManager.getConnection(DatabaseManager.java:73)
> >
> > at
> > com.eos.gds.data.DatabaseManager.getConnection(DatabaseManager.java:60)
> >
> > ............................................
> >
> > Caused by: java.util.NoSuchElementException: Timeout waiting for idle
> object
> >
> > at
> >
>
> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:958)
> >
> > at
> >
>
> org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:84)
> >
> > at
> >
>
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
> >
> > ... 28 more
> >
> >
> > com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
> > link failure
> >
> > Last packet sent to the server was 24 ms ago.
> >
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> >
> > at
> >
>
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> >
> > at
> >
>
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> >
> > at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> >
> > at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
> >
> > at
> > com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
> >
> > at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2873)
> >
> > at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2763)
> >
> > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3299)
> >
> > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
> >
> > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
> >
> > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
> >
> > at
> >
> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
> >
> > at
> >
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2022)
> >
> > at
> >
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1940)
> >
> > at
> >
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1925)
> >
> > at
> >
>
> org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
> >
> > at
> >
>
> com.eos.gds.cache.FareQuoteDBCache.storeItinQuotesIntoPresistentCache(FareQuoteDBCache.java:1029)
> >
> > at
> >
> com.eos.gds.cache.FareQuoteDBCache.processInputQueue(FareQuoteDBCache.java:899)
> >
> > at
> > com.eos.gds.cache.FareQuoteDBCache.access$000(FareQuoteDBCache.java:37)
> >
> > at
> > com.eos.gds.cache.FareQuoteDBCache$1.run(FareQuoteDBCache.java:103)
> >
> > at java.lang.Thread.run(Thread.java:619)
> >
> > Caused by: java.net.SocketException: Socket closed
> >
> > at java.net.SocketInputStream.socketRead0(Native Method)
> >
> > at java.net.SocketInputStream.read(SocketInputStream.java:129)
> >
> > at
> >
> com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
> >
> > at
> >
>
> com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
> >
> > at
> >
> com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
> >
> > at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2329)
> >
> > at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2774)
> >
> >
> >
> >
> > --
> > Regards,
> > Dhaval Jaiswal
> >
> >
> >
> >
> > --
> > Regards,
> > Dhaval Jaiswal
>



-- 
Regards,
Dhaval Jaiswal

Thread
Segmentation fault on a RAQ2 sysDaV3|D3)4 Aug
  • Segmentation fault on a RAQ2 syssinisa4 Aug
  • Fwd: DBCP errorDhaval Jaiswal6 May
    • Re: Fwd: DBCP errorNigel Wood6 May
      • Re: Fwd: DBCP errorDhaval Jaiswal11 May
    • RE: DBCP errorMartin Gainty6 May
      • Re: DBCP errorDhaval Jaiswal1 Jun
Re: DBCP errorDhaval Jaiswal11 May
  • DBCP errorDhaval Jaiswal12 May