-->
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: Determine of an object is loaded by app: ie, getEntity(Key)
PostPosted: Thu Dec 09, 2004 11:29 pm 
Beginner
Beginner

Joined: Fri Aug 27, 2004 1:59 pm
Posts: 33
I have an Account which is mapped to a set of Positions. When a new Position is created I only want to update Account's set if Account is already loaded in the Session cache. In other words, I want to limit any locking on Account unless some other aspect of the system has already loaded/locked the Account.

I see that SessionImplementor has the method that I need: getEntity(Key). But the application has access only to Session. I searched around the code a bit can't seem find any other applicable method. Is there a clean (or cleaner) way to achieve the above than downcasting Session to SessionImplementor? Maybe with a custom proxy on the inverse relationship from Postion to Account that drops the methods on the floor if the Account is not loaded. (But it seems that this still requires access to SessionImplementor.)

thanks!


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.