yes, this is a problem. class-descriptor refresh overrides reference-descriptor refresh. imo we should refresh the referenced instance in PersistenceBrokerImpl#retrieveReference. but this requires some enhancements in getDBObject to avoid loops.
jakob
Clute, Andrew wrote:
I should also mention this seems to be an issue with Collection as well....if a collection descriptor declares to refresh the collection objects, it will not do it of the class descriptor for the member class does not allow it to be refreshed.
-----Original Message-----
From: Clute, Andrew [mailto:[EMAIL PROTECTED] Sent: Thursday, October 16, 2003 12:31 PM
To: 'OJB Users List'
Subject: Problem with refreshing references; Possible bug?
I have found an issue that I think is a bug, but I want to make sure that is the case.
Given the following scenario:
Object A has 'refresh=true' on it's descriptor, and has a reference to Object B, and in the reference descriptor for Object B, 'refresh=true' is set as well.
However, Object B's class descriptor does not have the 'refresh=true' set.
In my scenario, when Object A is retrieved, I want to always refresh, and to refresh Object B...but I don't want Object B to be refreshed in every situation, only when Object A is getting refreshed.
Based upon having refresh attributes available on both the references and class descriptors, I would assume this would work.
However, looking through the code, when refreshing Object A, it will look
and correctly realize that it needs to refresh Object B, but when Object B
is then attempting to be refreshed, it looks at it's class descriptor and
sees that it does not need to refreshed, and returns the cached object.
So, even though the reference descriptor says to refresh, the object ignores it and doesn't because it the class descriptor for that class says it does not need to be refreshed.
Is this expected behavior?
For those who want to look at the code..
In the method PersistenceBrokerImpl.getReferencedObject() -- if the object is already in the cache, it will blindly call PersistenceBrokerImpl.getObjectByIdentity(), which will only look at the ClassDescriptor to determine whether or not to cache it, and not the ReferenceDescriptor that was determining that it need to be refreshed.
-Andrew
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
