-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: No Operations allowed after connection close...
PostPosted: Thu Apr 07, 2005 12:40 pm 
Beginner
Beginner

Joined: Thu Aug 19, 2004 5:20 am
Posts: 25
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:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 08, 2005 3:31 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Search the forum. This has been answered many many times.
http://forum.hibernate.org/viewtopic.php?t=935513&


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.