Hi,

we have a situation in which an object A contains another object B defined by a ReferenceDiscriptor.

The afterLookup method of A is called even though the object B inside object A is null. It seems to us that the calling sequence has changed that afterLokkup is called before the retrieval/Materialization of B takes place.
Here is A descriptor of B:
<reference-descriptor name="addressValue" class-ref="de.iqu.connector.valueobj.MAS90AddressValue"
auto-retrieve="true">


We have been checking the sqls generated and it seems that the proper lookup sqls for B are generated and do have a result set.
We have been debugging ojb and found the following behavior in QueryReferenceBroker:


method public void retrieveReference(Object obj, ClassDescriptor cld, ObjectReferenceDescriptor rds, boolean forced)

line 351     else if ((m_retrievalTasks != null) && !rds.isLazy()
                    && (rds.getItemProxyClass() == null))
            {
                addRetrievalTask(obj, rds);
                isRefObjDefined = false;
            }
where the else block evaluates to true for the reference in question.

This seems to result that the afterLookup method is called before the object has been retrieved since in method
private ManageableCollection getCollectionByQuery(Class collectionClass, Class itemClass, Query query)
throws ClassNotPersistenceCapableException, PersistenceBrokerException


The afterLookup is called in line 147
             Object candidate = iter.next();

and the method performRetrievalTasks(); only in line 187.


Any ideas on whether this is true, why ojb behaves like that and what can be done to make ojb call the afterLookup method only until after all references have been loaded?


By the way, we use ojb RC5, everything did work fine with ojb 0.9.8.

Thanks,

S.Schlösser


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to