-->
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: PROBLEM: Proxy with assigned ids and field access broken
PostPosted: Sat Jun 09, 2007 1:53 pm 
Newbie

Joined: Sun Jun 18, 2006 5:41 pm
Posts: 4
Hibernate version: tried with 3.1.3 and 3.2.4.sp1

Name and version of the database you are using: Derby 10.2.2.0

I am using field access for all my properties (access="field").
I am using an assigned value for my identifier (access="field").

Here's what I discovered:

1) My pojo class has been enhanced to include a CGLIBLazyInitializer. No problem.

2) Normal getters/setters have been modified to redirect the request to a target object held by the CGLIBLazyInitializer. Again, no problem.

3) My identifier method is not redirected to the target held by the CGLIBLazyInitializer. Instead, it accesses the identifier value on the proxy (byte enhanced pojo) which is null. This is a problem.

4) I've overriden equals and hashCode. My equals method is failing because it accesses the field value directly (byte enhanced pojo) which is null although the target object holds the correct value. This is a problem.

The symptoms aren't that widespread since my code doesn't encounter too many proxies. But when it shows up, it shows up big.

Anybody have a clue as to why I'm seeing this as a problem?

Thanks in advance,
Glenn


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 09, 2007 11:08 pm 
Newbie

Joined: Sun Jun 18, 2006 5:41 pm
Posts: 4
Okay...

Regarding (3) - The reason my accessors for object id were not working is becuase I had my methods declared as final.

Regarding (4) - This is a known "issue" with proxies and field access.

I will comment on these later.

Glenn


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.