-->
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: Result set already closed - Exception
PostPosted: Wed Dec 15, 2010 2:09 pm 
Newbie

Joined: Tue Aug 03, 2010 2:06 pm
Posts: 5
Hi ,

We have an application hosted in weblogic 8.1 . Transactions are managed by the container and the driver is XA. Recently we enabled no-proxy lazy loading for association mappings (many-to-one) . But we are getting an exception while accessing the associations. This exception doesn't occur for all associations. Also, this doesnt occur when the same piece of code is run stand alone. Exception comes only in weblogic. Anybody has any clues? Kindly help.

Exception:
org.hibernate.exception.GenericJDBCException: could not initialize lazy properties: [XXXXXXXXXXXXXX]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyPropertiesFromDatastore(AbstractEntityPersister.java:831)
at org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyProperty(AbstractEntityPersister.java:771)
at org.hibernate.intercept.AbstractFieldInterceptor.intercept(AbstractFieldInterceptor.java:97)
at org.hibernate.intercept.javassist.FieldInterceptorImpl.readObject(FieldInterceptorImpl.java:105)
at com.db.prisma.business.physicalUnitDomain.bo.SubUnit.$javassist_read_lnkPhysicalUnit(SubUnit.java)
at com.db.prisma.business.physicalUnitDomain.bo.SubUnit.getPhysicalUnit(SubUnit.java:674)
at com.db.prisma.business.instructionDomain.proxy.InstructionProxy.getInboundContract(InstructionProxy.java:1224)
...
....
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.Exe cuteThread.run(ExecuteThread.java:183)
Caused by: java.sql.SQLException: Result set already closed
at weblogic.jdbc.wrapper.ResultSet.getLong(ResultSet.java:516)

at org.hibernate.type.LongType.get(LongType.java:51)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173)
at org.hibernate.type.ManyToOneType.hydrate(ManyToOneType.java:126)

Thanks and Regards,
jivi


Top
 Profile  
 
 Post subject: Re: Result set already closed - Exception
PostPosted: Thu Dec 16, 2010 1:32 pm 
Newbie

Joined: Tue Aug 03, 2010 2:06 pm
Posts: 5
Looks like the issue was with connection release. In, JTASessionContext, connection release mode is AFTER_STATEMENT and it didnt go well with lazy loading.

Here is a solution i tried:

Created a new session context class extending JTASessionContext and overrode the method getConnectionReleaseMode() which returns the release mode AFTER_TRANSACTION.

It worked without any issues so far. But the doc says this should not be used in a JTA environment. Can someone please clarify why it should not be used in JTA?

Regards,
Jivi


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.