Actions
bug #7212
openCacheLoader replaces loaded entities with uninitialized proxies
Start date:
Due date:
% Done:
50%
Estimated time:
Severity:
critical
Found in Version:
Description
in the following code loaded entities are replaced by uninitialized proxies.
This completely breaks the caching mechanism whenever the entity by which the cache is being updated is initialized to a lesser extent than the entity graph which was originally put.
This can cause LazyInitializationExceptions and unexpected multiple referencing object problems
Object o = field.get(cdmEntity);
// resetting the value in cdm entity to the deproxied object
o = ProxyUtils.deproxy(o);
field.set(cdmEntity, o);
Object cachedo = field.get(cachedCdmEntity);
CdmBase cdmEntityInSubGraph = null;
if(update || ProxyUtils.isProxy(cachedo)) { // <<<<<<<<<<<< if o is an uninitialized proxy cachedo will be replaced !!!!!
// if we are in update mode we have to make the field of the cached entity
// up-to-date by setting it to the value of the cdm entity being loaded
//
// if the cdm entity is a proxy then we always update to make sure that
// newly created entities are always up-to-date
//
// NOTE : the field is overridden in the case of the exception
// found below
field.set(cachedCdmEntity, o);
}
Related issues
Updated by Andreas Kohlbecker about 6 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
Applied in changeset cdmlib|9a2bace3a566987c477b1e5150101b3091a1c292.
Updated by Andreas Kohlbecker about 6 years ago
wer kennt sich mit dem cache genügend aus um den review zu machen?
Updated by Katja Luther about 6 years ago
because of
o = ProxyUtils.deproxy(o);
I think o should never be a proxy. or am I wrong??
Updated by Andreas Kohlbecker about 6 years ago
the method signature is not really clear about the behavior of this method
It only de-proxies the passed object o
if it is an initialized proxy object,o
is returned.
Updated by Andreas Kohlbecker about 6 years ago
- Related to bug #7206: CdmEntityCache not correctly updating with entitiy graphs loaded afterwards added
Updated by Andreas Kohlbecker about 6 years ago
- Assignee changed from Andreas Kohlbecker to Andreas Müller
Actions