-->
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: multi loading of entities
PostPosted: Mon Nov 17, 2008 3:01 am 
Newbie

Joined: Fri Nov 14, 2008 5:35 pm
Posts: 3
Hi,
I have multiple, independent modules that holds reference to the same (persisted) entities. question is:
if I load them independently from each module, will Hibernate return the same references each time, or will it, for every call, generate new instances with the same data (that is, allocate NEW objects for each load)?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 3:54 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I don't know what you mean with modules. The things that matters is if you are using one or multiple Hibernate sessions.

Inside a single Hibernate session, object identity is guaranteed by Hibernate, meaning that you will only have one object representing the same pieces of data. Loading the same data from another session will create a new object for that session.

See http://www.hibernate.org/hib_docs/v3/re ... s-identity
for more information.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.