|Re: Be wary of transient nested inner class members [message #660824 is a reply to message #659721]
||Mon, 21 March 2011 19:24
| James Sutherland
Registered: July 2009
Location: Ottawa, Canada
EclipseLink enables a shared cache by default. This shared cache can either support maintaining transient variables, or not.|
If weaving is used, the shared cache objects are cloned to/from the persistence context, thus preserving the state of transient variables.
If weaving is not used, then new instances are created in the persistence context, and the non-transient state (only) is copied from the shared object.
So, if you don't want transients cached, then you can disable internal weaving ("eclipselink.weaving.internal"="false"), this will still allow weaving for LAZY and change tracking.
You could also disable the shared cache, or disable weaving entirely, or configure the CopyPolicy of your Entity, or use the DescriptorEvent postClone/postMerge.
James : Wiki : Book : Blog : Twitter
Powered by FUDForum
. Page generated in 0.01825 seconds