File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes Hibernate Result Set Closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Hibernate Result Set Closed" Watch "Hibernate Result Set Closed" New topic

Hibernate Result Set Closed

Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
Hi Guys

Hope someone can help me.

We are using Spring & Hibernate on a WebLogic 9.1 & and and Oracle 9i database. Most of our queries work fine except one query which throws a Result Set closed when Hibernate attempts to fetch the child collection (Object C in schematic below).

All the operations are performed within a Transaction and so are within a single Hibernate Session.

It appears that WebLogic is automatically closing the Result Sets which Hibernate needs in order to fetch the child collection.

Has anyone seen this before as I am baffled?


Approximate Mapping:
<Object A>
<many-to-one Object B>
<one-to-many Object C>
<many-to-one Object D/>
</one-to-many Object C>
</many-to-one Object B>
<one-to-many Object E/>
</Object A>

Partial Exception Stack Trace:
Caused by: java.sql.SQLException: Thread Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads] finds resultset already closed at Wed Apr 16 15:04:56 BST 2008 java.lang.Exception: Originally closed by Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads] at Wed Apr 16 15:04:54 BST 2008
at weblogic.jdbc.wrapper.ResultSet.internalClose(
at weblogic.jdbc.wrapper.Statement.closeAllResultSets(
at weblogic.jdbc.wrapper.Statement.internalClose(
at weblogic.jdbc.wrapper.Statement.internalClose(
at weblogic.jdbc.wrapper.Connection.closeAllStatements(
at weblogic.jdbc.wrapper.JTAConnection.closeAllStatements(
at weblogic.jdbc.wrapper.JTAConnection.releaseXAConnIfNeeded(
at weblogic.jdbc.wrapper.JTAConnection.getXAConn(
at weblogic.jdbc.wrapper.JTAConnection.checkConnection(
at weblogic.jdbc.wrapper.Statement.checkStatement(
at weblogic.jdbc.wrapper.Statement.doClose(
at weblogic.jdbc.wrapper.Statement.close(
at weblogic.jdbc.rmi.internal.StatementImpl.close(
at weblogic.jdbc.rmi.internal.PreparedStatementImpl_weblogic_jdbc_wrapper_PreparedStatement_oracle_jdbc_driver_T4CPreparedStatement_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(
at weblogic.rmi.internal.BasicServerRef$
at weblogic.rmi.internal.BasicServerRef.handleRequest(
at weblogic.rmi.internal.BasicServerRef.access$300(
at weblogic.rmi.internal.BasicServerRef$

Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33127

Moving to our Hibernate forum.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Is there more to that exception stack trace. I feel like I should be seeing a root cause there "caused by" Check the log file to see if there is more in there, rather than what appeared in a console window. If so, please post it. Are you using JPA? Are you no longer in a transaction? Is the Session now closed.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Andrew Bowes

Joined: Apr 18, 2005
Posts: 6
Hi Mark

The root cause is :

We are not using JPA. The whole operation is within a single method which is wrapped by a Spring Transactional Proxy and so should be within a single XA transaction and a the Hibernate Session should be open for the duration of the method call.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

That looks more like a Weblogic issue than an ORM or Hibernate problem. All the classes are in the Weblogic packages.

I am going to move this to the Weblogic forum.


Andrew Bowes

Joined: Apr 18, 2005
Posts: 6
Thanks Mark. Looks like this issue is a hot-potato, this is the 3rd forum that it's been on

I think that the issue may be related to the use of connections from a WebLogic Datasource on an Oracle XA connection pool used with a jUnit Test Case.
Avinash Shahdadpuri

Joined: Feb 25, 2009
Posts: 1

We are facing exact same issue on weblogic with hibernate. We see this at heavy load. Once this exception occurs, lot of hibernate collection loads cause the same exception.

Did you ever figure out, what was going around?

If yes, please let me know.
sridhar addanki

Joined: Mar 04, 2009
Posts: 22

I am new to Hibernate and Weblogic 10.3. I have installed weblogic 10.3. Developers want use Hibernate in their application. For this any thing need to be done at Weblogic server level. I mean any configuration need to be done.

Thanks in advance
I agree. Here's the link:
subject: Hibernate Result Set Closed
It's not a secret anymore!