Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1M2
-
None
-
None
Description
This is a new DI extension point - a strategy that defines whether changes from one ObjectContext are propagated to other ObjectContexts (in the same VM, or cross-VM, it should work the same). Similar to CAY-1586 (a strategy for retaining objects in the ObjectStore) this can be a single strategy class that uses a property that defines whether synchronization is to occur. The default is "true".
Some docs on synchronization is provided here: http://cayenne.apache.org/doc30/turning-off-context-synchronization.html
Turning off syncing may have a number of benefits:
1. If the app is running on the cluster, and remote synchronization is turned off, inconsistency is introduced - contexts local to a committing context get the changes, remote - don't.
2. Better performance - synchronization (even though run asynchronously) , has O(N) performance in respect to the number of contexts in the system. This is not scalable.
3. Optimistic locking may actually become usable. Currently optimistic locking in a typical webapp may not detect changes to objects due to background synchronization. While I haven't tried it with syncing being off, my assertion is that it will become more deterministic.