public final void commit(DataContainer container, Metadata metadata) {
//If possible, we now ensure copy-on-write semantics. This way, it can ensure the correct transaction isolation.
//note: this method is invoked under the ClusteringDependentLogic.lock(key)
//note2: we want to merge/copy to/from the data container value.
CacheEntry entry = container.get(key);
DeltaAware containerValue = entry == null ? null : (DeltaAware) entry.getValue();
if (containerValue != null && containerValue != value) {
value = containerValue;
}
if (value != null && !deltas.isEmpty()) {
final boolean makeCopy = value instanceof CopyableDeltaAware;