Fwd: DBCP error
am 06.05.2011 12:12:56 von Dhaval Jaiswal
--00248c0eefa2d3dc0a04a298bb38
Content-Type: text/plain; charset=ISO-8859-1
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(Ba sicDataSource.java:880)
at
com.eos.gds.data.DatabaseManager.getConnection(DatabaseManag er.java:73)
at
com.eos.gds.data.DatabaseManager.getConnection(DatabaseManag er.java:60)
.............................................
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at
org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObj ect(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(Nativ e
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:5 13)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLErr or.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:25 43)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedSta tement.java:1737)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedState ment.java:2022)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedState ment.java:1940)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedState ment.java:1925)
at
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.exec uteUpdate(DelegatingPreparedStatement.java:102)
at
com.eos.gds.cache.FareQuoteDBCache.storeItinQuotesIntoPresis tentCache(FareQuoteDBCache.java:1029)
at
com.eos.gds.cache.FareQuoteDBCache.processInputQueue(FareQuo teDBCache.java:899)
at
com.eos.gds.cache.FareQuoteDBCache.access$000(FareQuoteDBCac he.java:37)
at
com.eos.gds.cache.FareQuoteDBCache$1.run(FareQuoteDBCache.ja va: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(ReadAheadInput Stream.java:113)
at
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingS treamIfNecessary(ReadAheadInputStream.java:160)
at
com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInput Stream.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
--00248c0eefa2d3dc0a04a298bb38--
Re: Fwd: DBCP error
am 06.05.2011 12:35:30 von nwood
On Fri, 2011-05-06 at 11:12 +0100, Dhaval Jaiswal wrote:
> Caused by: java.net.SocketException: Socket closed
I'd suggest you look at server side timeout and maximum connection
settings in
http://dev.mysql.com/doc/refman/5.1/en/server-system-variabl es.html I'd
suspect wait_timeout is the setting you're interested in. You might also
want to check the maximum TCP session/idle timeouts on firewalls,
routers and other network devices between the failing system and its
MySQL server.
Hope that helps,
Nigel
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
RE: DBCP error
am 06.05.2011 14:24:39 von Martin Gainty
--_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@via.com
> To: mysql@lists.mysql.com
> CC: shrinivas.devarkonda@via.com
>=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(Ba sicDataSource=
..java:880)
>=20
> at
> com.eos.gds.data.DatabaseManager.getConnection(DatabaseManag er.java:73)
>=20
> at
> com.eos.gds.data.DatabaseManager.getConnection(DatabaseManag er.java:60)
>=20
> ............................................
>=20
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle obj=
ect
>=20
> at
> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObj ect(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(Nativ e
> Method)
>=20
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAc=
cessorImpl.java:39)
>=20
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConst=
ructorAccessorImpl.java:27)
>=20
> at java.lang.reflect.Constructor.newInstance(Constructor.java:5 13=
)
>=20
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
>=20
> at
> com.mysql.jdbc.SQLError.createCommunicationsException(SQLErr or.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:25 43=
)
>=20
> at
> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedSta tement.java:1=
737)
>=20
> at
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedState ment.java:202=
2)
>=20
> at
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedState ment.java:194=
0)
>=20
> at
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedState ment.java:192=
5)
>=20
> at
> org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.exec uteUpdate(Del=
egatingPreparedStatement.java:102)
>=20
> at
> com.eos.gds.cache.FareQuoteDBCache.storeItinQuotesIntoPresis tentCache(Far=
eQuoteDBCache.java:1029)
>=20
> at
> com.eos.gds.cache.FareQuoteDBCache.processInputQueue(FareQuo teDBCache.jav=
a:899)
>=20
> at
> com.eos.gds.cache.FareQuoteDBCache.access$000(FareQuoteDBCac he.java:37)
>=20
> at
> com.eos.gds.cache.FareQuoteDBCache$1.run(FareQuoteDBCache.ja va: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(ReadAheadInput Stream.java:1=
13)
>=20
> at
> com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingS treamIfNecess=
ary(ReadAheadInputStream.java:160)
>=20
> at
> com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInput Stream.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_--
Re: Fwd: DBCP error
am 11.05.2011 09:12:48 von Dhaval Jaiswal
--0015174733aec9694504a2facc4b
Content-Type: text/plain; charset=ISO-8859-1
interactive/wait_timeout = 120Seconds
max_connection = 1500
still we are getting errors.
--
Regards,
Dhaval
On Fri, May 6, 2011 at 4:05 PM, Nigel Wood wrote:
> On Fri, 2011-05-06 at 11:12 +0100, Dhaval Jaiswal wrote:
> > Caused by: java.net.SocketException: Socket closed
>
> I'd suggest you look at server side timeout and maximum connection
> settings in
> http://dev.mysql.com/doc/refman/5.1/en/server-system-variabl es.html I'd
> suspect wait_timeout is the setting you're interested in. You might also
> want to check the maximum TCP session/idle timeouts on firewalls,
> routers and other network devices between the failing system and its
> MySQL server.
>
> Hope that helps,
> Nigel
>
>
--
Regards,
Dhaval Jaiswal
--0015174733aec9694504a2facc4b--