-->
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: Hydrate fails storing loaded attribs
PostPosted: Thu Mar 16, 2006 5:08 pm 
Newbie

Joined: Thu Mar 16, 2006 4:05 pm
Posts: 1
(hibernate 3.0.5)

Does anyone know under what conditions a 1-M attribute can be dereferenced and lazy-loaded from the database, but then all its attributes are zero and empty because the type is <class>$$EnhancerByCGLIB$2e56093c?

The 1-M collection containing CGLIB proxy elements has all empty and zero business attributes, but all good CGLIB attributes: a real session, a CGLIB$BOUND = true, and a CGLIB$CALLBACK_0 attribute that is encapsulating all of the right values loaded from the database! But they don't hydrate/load/copy into the proxy object itself, so all my object's attributes are null or zero, except for the cglib attributes.

I'm loading an object (A) containing a 1-M collection of (B). I get a (B) from the collection, and (B) has a M-1 of (C). Class (C) has a non-null M-1 attribute of type (D), which is the reference that fails to hydrate.

When I access (C).getD(), it's always null, because the underlying foreign key value is always 0, even though accessing it causes a value of 112 to be loaded from the database.

Accessing (C).get(D) causes the following sequence of events, which looks correct to me:

    SessionImpl - initializing proxy: [(D):#112]
    BasicEntityPersister - Materializing entity: [(D):#112]
    Loader - Loading entity: [(D):#112]
    ShortType - binding '112' to parameter: 1
    BasicEntityPersister - Hydrating entity: [(D):#112]
    DefaultLoadEventListener - Loading entity: [(D):#PT] (what's PT??)
    DefaultLoadEventListener - Creating new proxy for entity
    TwoPhaseLoad - done materializing entity [(D):#112]
    Loader - done entity load


The problem is those values are loaded and stored in the CGLIB$CALLBACK_0 object, but they're not what's returned by the CGLIB proxy, presumably because they're never copied into the attributes of my class, whcih is the <class>$$EnhancerByCGLIB$2e56093c class.

This wouldn't have anything to do with max fetch depth, would it?

Thx,
David


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.