Serialization of Entities
In 1.x.x releases of OpenJPA, when an entity was serialized after calling EntityManager.find(), detach() or detachAll() then all Proxies references were removed as expected, but when the same entity instance was serialized after calling EntityManager.clear() the proxy classes were not removed.
This has two side-effects: when entities are remoted across JVM boundaries (RPC) or deserialized the OpenJPA runtime must be available on the classpath (both client and server containers); when entities are deserialized the OpenJPA runtime must be the exact same revision as used to serialize the entities due to the proxy classes using dynamically generated serialVersionUID values.
Starting with OpenJPA 2.0, this behavior has been modified, so that by default all proxies will be removed during serialization.
See Serialization on how the behavior changes based on the DetachedStateField setting along with Detached State for more details on how to override the default DetachedStateField setting.
Applications that use a 1.0 persistence.xml will automatically maintain the old behavior. It is possible for a version 2.0 application to revert back to the prior 1.x.x behavior by setting the following openjpa.Compatibility property as follows: