This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Hibernate Result Set Closed

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
author & internet detective
Posts: 41073
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our Hibernate forum.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic