Description:
Our application is running on JES2004q2 Application Server(7) with Mysql 4.1.11.On a heavy load when we perform the below operation then we are getting out of memory error.
Code Snippet:-
************
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DBUtil.getConnection("writeToTimer");
.....
DBUtil.getConnection()
********************
try {
con = cConnectionPool.getConnection(); con.setAutoCommit(false);//problem is occured here
return con;
.......
Connection Pool initialization:-
******************************
Context env = null;
if (cConnectionPool == null) {
try {
env = (Context) new InitialContext(); //get context
cConnectionPool = (DataSource) env.lookup(ConfigData.POOL_NAME);
.....
StackTrace:-
***********
com.sun.enterprise.resource.PoolingException: Communication link failure: java.net.SocketException, underlying cause: Connection reset
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Connection reset
STACKTRACE:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1391)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1538)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1929)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1906)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:2520)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:817)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1786)
at com.mysql.jdbc.Connection.<init>(Connection.java:450)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:398)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:131)
at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:88)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:745)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:271)
at com.sun.enterprise.resource.JdbcXAConnection$JdbcConnection.getCurrentConnection(JdbcXAConnection.java:642)
at com.sun.enterprise.resource.JdbcXAConnection$JdbcConnection.setAutoCommit(JdbcXAConnection.java:402)
at com.mot.gama.siepoc.utilities.dbutils.DBUtil.getConnection(DBUtil.java:144)
at com.mot.gama.siepoc.utilities.CdrUtils.writeToTimer(CdrUtils.java:120)
at com.mot.gama.siepoc.common.mdrgenerator.MDRGenerator.generateTimerCDR(MDRGenerator.java:143)
at com.mot.gama.siepoc.common.timers.ChargingSessionTimerTask.run(ChargingSessionTimerTask.java:84)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)
** END NESTED EXCEPTION **
at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:102)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:745)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:271)
at com.sun.enterprise.resource.JdbcXAConnection$JdbcConnection.getCurrentConnection(JdbcXAConnection.java:642)
at com.sun.enterprise.resource.JdbcXAConnection$JdbcConnection.setAutoCommit(JdbcXAConnection.java:402)
at com.mot.gama.siepoc.utilities.dbutils.DBUtil.getConnection(DBUtil.java:144)
at com.mot.gama.siepoc.utilities.CdrUtils.writeToTimer(CdrUtils.java:120)
at com.mot.gama.siepoc.common.mdrgenerator.MDRGenerator.generateTimerCDR(MDRGenerator.java:143)
at com.mot.gama.siepoc.common.timers.ChargingSessionTimerTask.run(ChargingSessionTimerTask.java:84)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)
java.sql.SQLException: Communication link failure: java.net.SocketException, underlying cause: Connection reset
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Connection reset
STACKTRACE:
java.
[23/Oct/2008:22:54:48] SEVERE (25797): net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1391)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1538)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1929)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1906)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:2520)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:817)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1786)
at com.mysql.jdbc.Connection.<init>(Connection.java:450)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:398)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:131)
at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:88)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:745)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:271)
at com.sun.enterprise.resource.JdbcXAConnection$JdbcConnection.getCurrentConnection(JdbcXAConnection.java:642)
at com.sun.enterprise.resource.JdbcXAConnection$JdbcConnection.setAutoCommit(JdbcXAConnection.java:402)
at com.mot.gama.siepoc.utilities.dbutils.DBUtil.getConnection(DBUtil.java:144)
at com.mot.gama.siepoc.utilities.CdrUtils.writeToTimer(CdrUtils.java:120)
at com.mot.gama.siepoc.common.mdrgenerator.MDRGenerator.generateTimerCDR(MDRGenerator.java:143)
at com.mot.gama.siepoc.common.timers.ChargingSessionTimerTask.run(ChargingSessionTimerTask.java:84)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)
** END NESTED EXCEPTION **
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1713)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1929)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1906)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:2520)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:817)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1786)
at com.mysql.jdbc.Connection.<init>(Connection.java:450)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:398)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:131)
at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:88)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:745)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:271)
at com.sun.enterprise.resource.JdbcXAConnection$JdbcConnection.getCurrentConnection(JdbcXAConnection.java:642)
at com.sun.enterprise.resource.JdbcXAConnection$JdbcConnection.setAutoCommit(JdbcXAConnection.java:402)
at com.mot.gama.siepoc.utilities.dbutils.DBUtil.getConnection(DBUtil.java:144)
How to repeat:
On a heavy load this problem occured.