-->
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: Proxy incorrectly eagerly initialized from load
PostPosted: Thu Jun 06, 2013 8:02 pm 
Newbie

Joined: Wed May 09, 2007 7:39 pm
Posts: 1
Hello, I have a situation where I have a UUID for an entity and am using the session.byId(MyClass.class).getReference(id) to get a reference to it (to use to populate a foreign key relationship). If I turn on my database trace I see that a query is emitted to do the query during the call to getReference. Strangely, if I step through the call stack. Then I get to line 149 in JavassistLazyInitializer#getProxy:

Code:
( ( ProxyObject ) proxy ).setHandler( instance );
instance.constructed = true;
return proxy;


the call to setHandler completes and I'm at a breakpoint before setting instance.constructed. At this point in time -- no calls to the database have been made and from what I can tell of this code path, Hibernate is trying to return a proxy as I want it to! Once I step over the instance.constructed = true that's when hibernate intiailizes the proxy calling the database and executing my select query! Is javassist catching the field store to constructed and executing the initialization logic?!

Anyone have any experience with this or ideas?


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.