aspose file tools *
The moose likes Object Relational Mapping and the fly likes getting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "getting "Problem with checked-in Statement, discarding "  in servlet scheduler" Watch "getting "Problem with checked-in Statement, discarding "  in servlet scheduler" New topic
Author

getting "Problem with checked-in Statement, discarding " in servlet scheduler

sabyasachi.roy
Greenhorn

Joined: Jun 08, 2007
Posts: 3
Hello Saloon,
I'm trying to run a scheduler from a servlet at a interval of 24 hrs..I'm using hibernate3.0,c3p0 0.9 for connection pooling,mysql connector 5.0.8,mysql 5.1 and jdk 1.6 and struts 1.2 along with apps server resin3.1...
After a server restart the scheduler run fine for 1 or 2 days..Then in the third day i get this exception..

2008-09-23 23:58:01,714 INFO com.mchange.v2.c3p0.stmt.GooGooStatementCache - Problem with checked-in Statement, discarding.
com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: No operations allowed after statement closed.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)
at com.mysql.jdbc.Statement.checkClosed(Statement.java:385)
at com.mysql.jdbc.PreparedStatement.clearParameters(PreparedStatement.java:678)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache.refreshStatement(GooGooStatementCache.java:604)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache.checkinStatement(GooGooStatementCache.java:236)
at com.mchange.v2.c3p0.impl.NewPooledConnection.checkinStatement(NewPooledConnection.java:239)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.close(NewProxyPreparedStatement.java:1807)
at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:417)
at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:197)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:213)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:143)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1281)
at org.hibernate.loader.Loader.doQuery(Loader.java:391)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.billpay.dao.MySqlTransactionDAO.getEntryDetails(MySqlTransactionDAO.java:835)
at com.billpay.utils.BillPayGenerateFile.run(BillPayGenerateFile.java:37)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
2008-09-23 23:58:01,714 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01
2008-09-23 23:58:01,714 ERROR org.hibernate.util.JDBCExceptionReporter - Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Broken pipe

STACKTRACE:

java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2744)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1612)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1467)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1272)
at org.hibernate.loader.Loader.doQuery(Loader.java:391)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.billpay.dao.MySqlTransactionDAO.getEntryDetails(MySqlTransactionDAO.java:835)
at com.billpay.utils.BillPayGenerateFile.run(BillPayGenerateFile.java:37)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)


** END NESTED EXCEPTION **



Last packet sent to the server was 0 ms ago.
2008-09-23 23:58:01,715 ERROR com.billpay.dao.MySqlTransactionDAO - org.hibernate.exception.GenericJDBCException: could not execute query

Any idea what can be the reason for this..Is it configuration issue or code related issue?Can anybody help me in resolving this issue?
 
jQuery in Action, 2nd edition
 
subject: getting "Problem with checked-in Statement, discarding " in servlet scheduler