-->
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: Obtain readonly entity?
PostPosted: Sun Oct 30, 2005 10:25 pm 
Beginner
Beginner

Joined: Fri Oct 28, 2005 10:46 am
Posts: 37
There is some discussion going on in my place of employment about Hibernate's behavior in always returning new instances of objects from the second-level cache rather than returning a single cached instance (in comparsion with TopLink, which does the latter). The issue under discussion is the efficiency of creating unnecessary instances. I personally prefer the way Hibernate does it because it just seems generally safer, but I'm wondering if there is an option for obtaining a sort of "readonly" instance which could be shared between multiple users/threads safely because it will never be modified. The developer would take responsibility for ensuring that no changes will be made to the object's state. In other words, you might have a "findForEdit" and a "findForView" method for an entity. The former will always give you your own instance, and the latter would give you a shared instance that you have to make sure is never modified.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 8:26 pm 
Beginner
Beginner

Joined: Fri Oct 28, 2005 10:46 am
Posts: 37
Bumping and hoping for a reply


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.