-->
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.  [ 8 posts ] 
Author Message
 Post subject: Cache Problem ??
PostPosted: Tue May 29, 2007 8:48 am 
Newbie

Joined: Tue May 29, 2007 8:24 am
Posts: 5
Not sure this is the right forum but any help would highly appreciated -

I am using Hibernate v3.2.2 with ehCache v1.2.4 and i am getting following exception while trying to marshal an object to XML using jibx. This works fine for initial hits but starts failing after that. Also, if i remove ehcache, this works fine. As a workaround, i can clear out hibernate cache and this works fine but i can't do it always. Also, the object i am trying to marshal is quite big and goes very deep in the object hirerchy, contains many collections. So, clearing out individual object is not easy..as for that i have to go through each object and then subobjects and so on.

---------------------------------------------------------
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.deploy.atao.model.DisplaySetValue.localeDisplaySetValue, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
at org.hibernate.collection.PersistentMap.size(PersistentMap.java:114)
at org.jibx.extras.HashMapperStringToComplex.marshal(Unknown Source)
at ....
so on
-------------------------------------------------------------

Please let me know if you want any more information.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 9:12 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

use lazy=false in your list element


Amila

(Don't forget to rate if helps)


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 9:13 am 
Beginner
Beginner

Joined: Fri May 18, 2007 10:28 am
Posts: 48
Location: Madison, WI
Can you try increasing the time-out parameter.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 9:42 am 
Newbie

Joined: Tue May 29, 2007 8:24 am
Posts: 5
amila733 wrote:
Hi

use lazy=false in your list element


Amila

(Don't forget to rate if helps)


"I can't. I don't want to unnecessarily load objects that would be a hit on performance "


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 9:49 am 
Newbie

Joined: Mon May 28, 2007 10:37 am
Posts: 3
In that case keep your session open while you are hydrating the object graph to parse the same into XML.

-K
(Rate if this helped)


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 9:52 am 
Newbie

Joined: Tue May 29, 2007 8:24 am
Posts: 5
satsranchuser wrote:
Can you try increasing the time-out parameter.


"OK....i done that but no help!!. I am not sure about exact reason for this failure....can anyone dig into Hibernate code and tell me exactly when i can get this error ?.

This may help you in further debugging -
I am using distributed caching and it is possible that object i am working on is updated on another site and please don't ask me to remove distributed caching....i can't :("


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 9:58 am 
Newbie

Joined: Tue May 29, 2007 8:24 am
Posts: 5
kunalmeh wrote:
In that case keep your session open while you are hydrating the object graph to parse the same into XML.

-K
(Rate if this helped)


"Session is open....i can see its open even after exception."


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 04, 2007 5:12 pm 
Beginner
Beginner

Joined: Mon May 21, 2007 5:22 pm
Posts: 27
Location: Salt Lake City
Try to change the ehcache.xml settings for your object cache.

Also you can manage this with the programatic ehcaching.

_________________
Try 'N' Enjoy !!
Rahul

If helpful do rating ....


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