-->
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.  [ 3 posts ] 
Author Message
 Post subject: No operations allowed after statement closed. - Any Ideas
PostPosted: Fri Mar 09, 2007 10:13 am 
Newbie

Joined: Thu Mar 01, 2007 8:35 am
Posts: 3
I get the following Exception frequently while executing my code. It does not always occur. After looking at Hibernate debug. I saw the PreparedStatement getting closed before this exception shows up. What events initiate the closure of PreparedStatement. Any suggestions to avoid this are greatly appreciated.

regards.
Sharath

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Caused by: 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:369)
at com.mysql.jdbc.ServerPreparedStatement.checkClosed(ServerPreparedStatement.java:420)
at com.mysql.jdbc.ServerPreparedStatement.setString(ServerPreparedStatement.java:1852)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:131)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:131)
at org.hibernate.type.StringType.set(StringType.java:26)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:85)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:63)
at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1514)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1576)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 3:57 pm 
Regular
Regular

Joined: Wed Dec 07, 2005 4:19 pm
Posts: 53
You would have to provide more detail to get any help.

A _complete_ stack trace, and your code involved in this operation. Are you doing something explicit with the connection (session.connection()) ?

Martin.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 19, 2007 6:36 am 
Newbie

Joined: Thu Mar 01, 2007 8:35 am
Posts: 3
I was using DBCP connection pooling. But now i started using c3p0 (0.9.1.1) and the problem seems to have vanished. i'll still keep a monitor on my code incase it is not the cause.

Regards and Thanks for all the help.

Sharath


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