Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hi Everyone
i have a piece of code that gets 3 different sessions from various MySQL databases. MySQL is version 4.0.17 Hibernate is 2.1
the code gets batches of a 1000 files and then processes them
Now it will run perfectly for 2 hours but sometimes when it connects to get the next batch it will throw the error below, which comes from trying to query a particular table
when it does throw this error it ALWAYS throws it on the first couple of records, if it gets past those its fine.
then if i shut it down and start it up again its fine.
Any ideas?
Is there anywhere i can set the connections to remain longer in the pool?
Hibernate Version 2.1
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
java.sql.SQLException: No operations allowed after connection closed at com.mysql.jdbc.Connection.checkClosed(Connection.java:2497) at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1287) at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1267) at net.sf.hibernate.impl.SessionFactoryImpl.getPreparedStatement(SessionFactoryImpl.java:543) at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:50) at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:395) at net.sf.hibernate.loader.Loader.doFind(Loader.java:118) at net.sf.hibernate.loader.Loader.find(Loader.java:507) at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:856) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1329) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:68) at dse6.processors.v9.MatterdataProcessor.loadMatterData(MatterdataProcessor.java:207) at dse6.processors.v9.bonds.FNBProcessor.run(FNBProcessor.java:135) at dse6.DSE6Core.run(DSE6Core.java:537) at dse6.DSE6Runner.(DSE6Runner.java:31) at dse6.DSE6Runner.main(DSE6Runner.java:76) rethrown as net.sf.hibernate.JDBCException: Could not execute query: No operations allowed after connection closed at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1332) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:68) at dse6.processors.v9.MatterdataProcessor.loadMatterData(MatterdataProcessor.java:207) at dse6.processors.v9.bonds.FNBProcessor.run(FNBProcessor.java:135) at dse6.DSE6Core.run(DSE6Core.java:537) at dse6.DSE6Runner.(DSE6Runner.java:31) at dse6.DSE6Runner.main(DSE6Runner.java:76) Caused by: java.sql.SQLException: No operations allowed after connection closed at com.mysql.jdbc.Connection.checkClosed(Connection.java:2497) at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1287) at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1267) at net.sf.hibernate.impl.SessionFactoryImpl.getPreparedStatement(SessionFactoryImpl.java:543) at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:50) at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:395) at net.sf.hibernate.loader.Loader.doFind(Loader.java:118) at net.sf.hibernate.loader.Loader.find(Loader.java:507) at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:856) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1329) ... 6 more
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: