-->
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: ..PreparedStatement is closed Exception
PostPosted: Tue Mar 17, 2009 11:13 am 
Newbie

Joined: Tue Mar 17, 2009 10:55 am
Posts: 1
I'm getting java.sql.SQLException: org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement is closed.

This is occurring within a spring managed hibernate session but not consistently. That is, upon server startup, all works well for any given criteria until, for some reason it stops working and we get the exception. At that point we can reliably reproduce the exception.

I will happily post more info if needed.

Thanks for any help!
Ben

Hibernate version: 3.2.1 GA

Full stack trace of exception:
Code:
java.sql.SQLException: org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement is closed.
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.checkOpen(DelegatingStatement.java:136)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.getMaxRows(DelegatingStatement.java:234)
        at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:272)
        at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:209)
        at org.hibernate.loader.Loader.doQuery(Loader.java:714)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2211)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
        at org.hibernate.loader.Loader.list(Loader.java:2090)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)


database: Oracle 10G (ojdbc14.jar)
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 17, 2009 5:07 pm 
Newbie

Joined: Fri Nov 03, 2006 10:01 am
Posts: 6
Well, I can't help too much. I'd guess that either you have some code somewhere that is committing the transaction or explicitly closing the Session. Another possibility is that you don't have your Spring-managed Sessions working correctly. Perhaps one Session that should be discarded is hanging around on a ThreadLocal variable and not being cleaned up?

I'm not sure which connection pool you are using, but perhaps there is a bug in the connection pool?


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.