-->
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.  [ 6 posts ] 
Author Message
 Post subject: JDBCExceptionReporter - You can't operate on a closed connec
PostPosted: Wed Jun 01, 2005 8:46 pm 
Newbie

Joined: Wed Jun 01, 2005 8:26 pm
Posts: 5
Hibernate version: 3.0 (31.3.2005)

I have an application that is running on
Tomcat 4.1.31
Java 1.4.2_08.
mysql-connector-java-3.1.8
mysql Ver 14.7 Distrib 4.1.11, for Win32 (ia32)

In my windows XP laptop it works fine. When I transfer the .war file to
Linux (same rev of java, hibernate, and MySQL) it fails intermittently.
On screens that acces the databas it throws an exception about 20% of the time.

Any ideas?

There are two errors that show up. (Only on the linux box)
First is a very frequent short exception that does not seem to hurt the application any is ...

Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main] -- caught unexpected Exception while executing posted task.
java.lang.NullPointerException
at com.mysql.jdbc.ServerPreparedStatement.realClose(ServerPreparedStatement.java:1101)
at com.mysql.jdbc.ServerPreparedStatement.close(ServerPreparedStatement.java:706)
at com.mchange.v1.db.sql.StatementUtils.attemptClose(StatementUtils.java:38)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1.run(GooGooStatementCache.java:246)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354)

The error that causes the app to bomb is...
(ThreadPoolAsynchronousRunner.java:354)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main] -- caught unexpected Exception while executing posted task.
java.lang.NullPointerException
UserMapper.findParentByLoginID() found login for User rkeene
at com.mysql.jdbc.ServerPreparedStatement.realClose(ServerPreparedStatement.java:1101)
at com.mysql.jdbc.ServerPreparedStatement.close(ServerPreparedStatement.java:706)
at com.mchange.v1.db.sql.StatementUtils.attemptClose(StatementUtils.java:38)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1.run(GooGooStatementCache.java:246)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354)
22:10:10,504 ERROR JDBCExceptionReporter:58 - You can't operate on a closed connection!!!
0 [http-8080-Processor5] ERROR org.hibernate.util.JDBCExceptionReporter - You can't operate on a closed connection!!!
22:10:10,514 ERROR KidelityServlet:? - Top level exception
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1518)
at org.hibernate.loader.Loader.list(Loader.java:1498)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:266)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:788)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.kidelity.mapper.UserMapper.findUserById(Unknown Source)
at com.kidelity.handler.SBL.getUser(Unknown Source)
at com.kidelity.handler.SBL.isInRole(Unknown Source)
at com.kidelity.handler.LoginHandler.chooseMainByRoles(Unknown Source)
at com.kidelity.handler.LoginHandler.processEvents(Unknown Source)
at com.kidelity.handler.LoginHandler.handle(Unknown Source)
at com.kidelity.servlet.KidelityServlet.callHandlersUntilDone(Unknown Source)
at com.kidelity.servlet.KidelityServlet.processRequest(Unknown Source)
at com.kidelity.servlet.KidelityServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:696)
at

_________________
Inside every complex program is a simple program try ing to get out.


Top
 Profile  
 
 Post subject: More
PostPosted: Wed Jun 01, 2005 8:48 pm 
Newbie

Joined: Wed Jun 01, 2005 8:26 pm
Posts: 5
Using C3PO with no changes from the standard example that comes with
hibernate.

_________________
Inside every complex program is a simple program try ing to get out.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 11:19 pm 
C3P0 Developer
C3P0 Developer

Joined: Tue Jan 06, 2004 8:58 pm
Posts: 145
Hi. Please try upgrading to c3p0-0.9.0-pre6. There were several c3p0 bugs where a Connection would prematurely get closed from underneath clients if an Exception occurred and a subsequent Connection test failed. These are all hopefully fixed, but don't take my word, try the latest and let me know if you still see a problem.

Thanks!

Steve (c3p0 guy)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 12:26 am 
Newbie

Joined: Wed Jun 01, 2005 8:26 pm
Posts: 5
Upgrading to the latest hibernate worked.
Thanks

_________________
Inside every complex program is a simple program try ing to get out.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 9:41 am 
Newbie

Joined: Wed Jul 26, 2006 10:35 am
Posts: 11
I'm having the very same problem.

However, the Hibernate version I use is 2.1.3. Upgrading Hibernate is no option. I tried the latest c3p0 (0.9.0.2).

Which version of c3p0 should I use so I don't get above error?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 7:14 pm 
C3P0 Developer
C3P0 Developer

Joined: Tue Jan 06, 2004 8:58 pm
Posts: 145
Please try c3p0-0.9.1-pre9. The 0.9.1 series is quite mature. I expect there will be one more prerelease with very, very minor changes, and then 0.9.1 final.

smiles,
Steve


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.