3.14.2.5. Data Replication

While Slice ensures that the transitive closure is stored in the same slice, there can be data elements that are commonly referred by many instances such as Country or Currency code. Such quasi-static master data can be stored as identical copies in multiple slices. The user application must enumerate the replicated entity type names in openjpa.slice.ReplicatedTypes as a comma-separated list and implement a org.apache.openjpa.slice.ReplicationPolicy interface. The ReplicationPolicy interface is quite similar to DistributionPolicy interface except it returns an array of target slice names instead of a single slice.

			 String[] replicate(Object pc, List<String> slices, Object context);

The default implementation assumes that replicated instances are stored in all available slices. If any such replicated instance is modified then the modification is updated to all target slices to maintain the critical assumption that the state of a replicated instance is identical across all its target slices.