You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by "Clute, Andrew" <An...@osn.state.oh.us> on 2004/05/12 23:36:33 UTC

Bug in QueryReferenceBroker?

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);
             }
         }
          else
          {
              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?

-ANdrew