openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Cudennec" <>
Subject Re: Auditing: Tests and maps
Date Thu, 22 Dec 2011 09:44:33 GMT
Hi Pinaki,

your proposal led me to the solution. The good news is: I can track the changes by changing
the code the way you proposed.

What puzzled me and made me think that this must be a bug in OpenJPA is the fact that the
field "stringAttributes" was marked as dirty but the Map from the oldState (SaveFieldManager#getState)
contained the modified StringAttribute instance with the new value. It looks like the oldState
does not exactly represent the original state from the time when the object was loaded.



-------- Original-Nachricht --------
> Datum: Wed, 21 Dec 2011 09:16:42 -0800 (PST)
> Von: Pinaki Poddar <>
> An:
> Betreff: Re: Auditing: Tests and maps

> Hi Christopher,
>    > a.getStringAttributes().get("key").setValue("new value")); 
>    This line is the culprit (or JPA as a whole is). It is a conceptual
> problem with JPA, in general.
> JPA is managing the field Map<String, StringAttribute> stringAttributes,
> but
> it can not understand that a value in the Map has been directly changed
> underneath. One way will be to rewrite it as:
>    a.getStringAttributes().put("key", new StringAttribute("new value")); 
>   This way a JPA runtime (which has proxied the Map to track changes) will
> become aware that the Map is dirty.
> -----
> Pinaki Poddar
> Chair, Apache OpenJPA Project
> --
> View this message in context:
> Sent from the OpenJPA Users mailing list archive at

NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren:

View raw message