db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clute, Andrew" <Andrew.Cl...@osn.state.oh.us>
Subject Bug in QueryReferenceBroker?
Date Wed, 12 May 2004 21:36:33 GMT
I recently updated to HEAD and am finding a weird issue now.

I have an object Session, that has a reference to an Object called
Person. Now Person is a proxy object. I am using an Anonymous FK to
reference Person from Session.

When I try to restore Session when it has no Person hanging on it, it
restores the Session object with a Person Proxy object hanging off of it
(it shouldn't!), and the Proxy's PK being a collection of null.

I think I might have narrowed down why it is happening:

Method getReferencedObjectIdentity(), here is a code snipet:

 if (hasNullifiedFKValue)
      if(isAnonymousKeyReference(cld, rds))
            Object referencedObject = rds.getPersistentField().get(obj);
             if(referencedObject != null)
                return new Identity(referencedObject, pb);
              return null;

     // ensure that top-level extents are used for Identities
     return new Identity(rds.getItemClass(),
pb.getTopLevelClass(rds.getItemClass()), fkValues);

In my case, I have a nullifiedFKValue, so it goes into the first If
block, and then it sees that it is an AnonymousKeyReference, but then my
referencesObject us null (like it should be). But instead of returning
null, it jums out to the bottom where it returns a new Identity!! Why is
it doing that? I can see where Armin has made some changes to handle
better AnonymousFK's, is this a side-effect of that?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message