3.13. Remote and Offline Operation
The standard JPA runtime environment was originally just local and online.
It is local in that components such as EntityManagers and queries connect directly to the datastore and execute their actions in the same JVM as the code using them.
It is online in that all changes to managed objects must be made in the context of an active EntityManager.
These two properties, combined with the fact that EntityManagers cannot be serialized for storage or network transfer, made the standard JPA runtime difficult to incorporate into some enterprise and client/server program designs.
JPA has now provided offline capability through the detach() and merge() methods on the EntityManager interface. OpenJPA has extended this to include additional detach…() and merge…() methods. All of these are documented in Detach and Attach APIs. In addition, OpenJPA has added remote capability in the form of Remote Commit Events. The following sections explain these capabilities in detail.