-->
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: Application design issue
PostPosted: Thu Mar 13, 2008 5:43 pm 
Newbie

Joined: Sat Jul 22, 2006 3:08 pm
Posts: 6
Hello
I've been using hibernate for a while now with my application.
Lately i started optimizing the code and applied the structure
from well known "Hibernate in Action".
Now I have a thread-local session.
It works very nice but I started getting "a different object with the same identifier value was already associated with the session" exceptions.

I think I know the reason.
First I load "model" list to show it on the screen for selection by users.
When the user selects particular model I'm trying to load it again with all the details for it.

Question:
What is common way of doing it?
Should I load the whole list of "models" and keep it in the session and work only on this list without reloading it again from the DB ?
The way I wanted to do it is
1. Load the list just do display "model" names for selection.
2. When selected load that model from the DB

Problem is that that list of models is stuck somewhere in hibernate objects and I currently don't have access to it.

Or may be I should evict each "model" from the list after loading ?

Alex


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.