-->
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.  [ 1 post ] 
Author Message
 Post subject: Lazy loading again
PostPosted: Fri Jun 30, 2006 7:30 pm 
Newbie

Joined: Fri Jun 30, 2006 6:55 pm
Posts: 2
Ok! we have partly solved the problem of lazy loading in our application, but we have something more over here.

Consider a hierarchy of model objects (or value objects) as:
A contains B
A contains C <Set>
A contains D
... and a few more associations

In my A.hbm.xml and other files i've lazy loading turned on for B,C and D. I display a list of A's in my jsp and it displays fine inspite of the jsp accessing the other embedded objects (because i have configured the OpenSessionInView filter.. and it works fine).

Now the user selects a particular A (out of the list displayed) and different parts of object A is displayed in various tabs in the application. So in the first tab, i get the A from the database (depending upon the id passed in the previous page) and display (say just the B part). Here the user can make changes to B.

I need to save the changes that user makes to B (or effectively A) while the user 'tabs' back and forth in various pages to see the other objects B, C and D. Therefore i need to store A in session and cannot get it from the DB.

When i tab back and forth in various tabs, the jsp's try to access the un-initialized B, set of C, D .. etc. there by causing LazyInitializationException.

Does any one out here face a situation like this? If yes, how do you solve this case? I have one way, but to be honest i dont like that approach.

Any ideas, clues?

My apologies for the lengthy problem statement/ description but it couldn't have helped in any other way.

cheers
nik


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.