permaculture playing cards*
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
Author

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?

Thanks
Andy




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(ResultSet.java:133)
at weblogic.jdbc.wrapper.Statement.closeAllResultSets(Statement.java:204)
at weblogic.jdbc.wrapper.Statement.internalClose(Statement.java:309)
at weblogic.jdbc.wrapper.Statement.internalClose(Statement.java:281)
at weblogic.jdbc.wrapper.Connection.closeAllStatements(Connection.java:364)
at weblogic.jdbc.wrapper.JTAConnection.closeAllStatements(JTAConnection.java:154)
at weblogic.jdbc.wrapper.JTAConnection.releaseXAConnIfNeeded(JTAConnection.java:228)
at weblogic.jdbc.wrapper.JTAConnection.getXAConn(JTAConnection.java:197)
at weblogic.jdbc.wrapper.JTAConnection.checkConnection(JTAConnection.java:68)
at weblogic.jdbc.wrapper.Statement.checkStatement(Statement.java:256)
at weblogic.jdbc.wrapper.Statement.doClose(Statement.java:348)
at weblogic.jdbc.wrapper.Statement.close(Statement.java:335)
at weblogic.jdbc.rmi.internal.StatementImpl.close(StatementImpl.java:125)
at weblogic.jdbc.rmi.internal.PreparedStatementImpl_weblogic_jdbc_wrapper_PreparedStatement_oracle_jdbc_driver_T4CPreparedStatement_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:550)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:440)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:436)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:58)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:975)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)


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
Marshal

Joined: May 26, 2003
Posts: 30948
    
158

Moving to our Hibernate forum.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

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.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Andrew Bowes
Greenhorn

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
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

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.

Thanks

Mark
Andrew Bowes
Greenhorn

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
Greenhorn

Joined: Feb 25, 2009
Posts: 1
Andrew,

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
Greenhorn

Joined: Mar 04, 2009
Posts: 22
Hi,

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: http://aspose.com/file-tools
 
subject: Hibernate Result Set Closed