Top Description Fields Constructors Methods
org.eclipse.persistence.internal.sessions

public Class MergeManager

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashSet, .IdentityHashMap, .Iterator, .List, .Map, .Set, org.eclipse.persistence.descriptors.ClassDescriptor, .VersionLockingPolicy, org.eclipse.persistence.exceptions.OptimisticLockException, .QueryException, .ValidationException, org.eclipse.persistence.internal.descriptors.ObjectBuilder, .OptimisticLockingPolicy, .PersistenceEntity, org.eclipse.persistence.internal.helper.linkedlist.LinkedNode, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.localization.ExceptionLocalization, org.eclipse.persistence.internal.sessions.remote.ObjectDescriptor, .RemoteUnitOfWork, org.eclipse.persistence.logging.SessionLog, org.eclipse.persistence.mappings.DatabaseMapping, org.eclipse.persistence.queries.DoesExistQuery, org.eclipse.persistence.sessions.SessionProfiler, org.eclipse.persistence.sessions.remote.DistributedSession

Purpose: Used to manage the merge of two objects in a unit of work.

Author
James Sutherland
Since
TOPLink/Java 1.1

Field Summary

Modifier and TypeField and Description
protected ArrayList<CacheKey>
acquiredLocks

Used to store the list of locks that this merge manager has acquired for this merge

public static final int
public static final int
public static final int
protected int
cascadePolicy

Policy that determines how the merge will cascade to its object's parts.

protected static final int
protected static final int
protected static final int
protected boolean
forceCascade

Force cascade merge even if a clone is already registered

protected boolean
isForRefresh

records that this merge process is for a refresh

protected boolean
isTransitionedToDeferredLocks

records that deferred locks have been employed for the merge process

public static boolean
LOCK_ON_MERGE

Backdoor to disable merge locks.

protected Thread
lockThread

save the currentThread for later comparison to the activeThread in case they don't match

protected IdentityHashMap<Object, Object>
mergedNewObjects

Used to keep track of merged new objects.

protected int
mergePolicy

Policy that determines merge type (i.e. merge is used for several usages).

public static final int
protected Map<Object, ObjectDescriptor>
objectDescriptors

Used only while refreshing objects on remote session

protected Map<AbstractSession, Map<Object, Object>>
objectsAlreadyMerged

Used to unravel recursion.

protected static final int
protected LinkedNode
queueNode

Stores the node that holds this mergemanager within the WriteLocksManager queue

protected static final int
protected AbstractSession
session

The unit of work merging for.

protected long
systemTime

Stored so that all objects merged by a merge manager can have the same readTime.

protected static final int
protected static final int
protected Object
writeLockQueued

If this variable is not null then the mergemanager is waiting on a particular primary key

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
cascadeAllParts()

Cascade all parts, this is the default for the merge.

public void
cascadePrivateParts()

Cascade private parts, this can be used to merge clone when using RMI.

public void
checkNewObjectLockVersion(Object clone, Object primaryKey, ClassDescriptor descriptor, UnitOfWorkImpl unitOfWork)

Check if the new object's version has been set, if so, then it was an existing object that was deleted.

public void
dontCascadeParts()

Merge only direct parts, this can be used to merge clone when using RMI.

public ArrayList<CacheKey>
public int
public Thread

Returns:

lockThread
getLockThread
()

INTERNAL:

public IdentityHashMap<Object, Object>

Returns:

Map
getMergedNewObjects
()

INTERNAL: Used to return a map containing new objects found through the registerObjectForMergeCloneIntoWorkingCopy method.

public Object
protected int
public Map<Object, ObjectDescriptor>
public Map<AbstractSession, Map<Object, Object>>
public Object
getObjectToMerge(Object sourceValue, ClassDescriptor descriptor, AbstractSession targetSession)

public LinkedNode
getQueueNode()

INTENRAL: Used to get the node that this merge manager is stored in, within the WriteLocksManager write lockers queue

public AbstractSession
public long
getSystemTime()

Get the stored value of the current time.

public Object
getTargetVersionOfSourceObject(Object source, ClassDescriptor descriptor, AbstractSession targetSession)

Return the corresponding value that should be assigned to the target object for the source object.

public Object
getWriteLockQueued()

INTENRAL: Used to get the object that the merge manager is waiting on, in order to acquire locks

public boolean
isAlreadyMerged(Object object, AbstractSession targetSession)

public boolean

Returns:

the isForMerge
isForRefresh
()

public boolean
isTransitionedToDeferredLocks()

INTERNAL: Will return if the merge process has transitioned the active merge locks to deferred locks for readlock deadlock avoidance.

public Object
mergeChanges(Object object, ObjectChangeSet objectChangeSet, AbstractSession targetSession)

Recursively merge changes in the object dependent on the merge policy.

protected Object
mergeChangesForRefreshingRemoteObject(Object serverSideDomainObject)

Recursively merge the RMI clone from the server into the client unit of work working copy.

public void
mergeChangesFromChangeSet(UnitOfWorkChangeSet uowChangeSet)

INTERNAL: Merge the changes to all objects to session's cache.

protected Object
mergeChangesIntoDistributedCache(Object original, ObjectChangeSet changeSet)

Merge the changes specified within the changeSet into the cache.

protected Object
mergeChangesOfCloneIntoWorkingCopy(Object rmiClone)

Recursively merge to rmi clone into the unit of work working copy.

protected Object
mergeChangesOfOriginalIntoWorkingCopy(Object clone)

Recursively merge to original from its parent into the clone.

protected Object
mergeChangesOfWorkingCopyIntoOriginal(Object clone, ObjectChangeSet objectChangeSet)

Recursively merge to clone into the original in its parent.

protected CacheKey
mergeChangesOfWorkingCopyIntoOriginal(Object clone, ObjectChangeSet objectChangeSet, ClassDescriptor descriptor, AbstractSession targetSession, UnitOfWorkImpl unitOfWork)

Recursively merge to clone into the original in its parent.

public Object
mergeChangesOfWorkingCopyIntoRemote(Object clone)

Recursively merge changes in the object dependent on the merge policy.

public void
mergeCloneIntoWorkingCopy()

This can be used by the user for merging clones from RMI into the unit of work.

public void
mergeCloneWithReferencesIntoWorkingCopy()

This is used during the merge of dependent objects referencing independent objects, where you want the independent objects merged as well.

public void
mergeIntoDistributedCache()

This is used during cache synchronization to merge the changes into the distributed cache.

public Object
mergeNewObjectIntoCache(ObjectChangeSet changeSet)

Merge a change set for a new object into the cache.

public void
mergeOriginalIntoWorkingCopy()

This is used to revert changes to objects, or during refreshes.

public void
mergeWorkingCopyIntoOriginal()

This is used during the unit of work commit to merge changes into the parent.

public void
mergeWorkingCopyIntoRemote()

This is used during the unit of work commit to merge changes into the parent.

public void
recordMerge(Object key, Object value, AbstractSession targetSession)

public void
refreshRemoteObject()

INTERNAL: This is used to refresh remote session object

public Object
registerExistingObjectOfReadOnlyClassInNestedTransaction(Object source, ClassDescriptor descriptor, AbstractSession targetSession)

INTERNAL: Used to register an existing object used in nested unit of work with read-only class in root unit of work.

protected Object
registerObjectForMergeCloneIntoWorkingCopy(Object clone, boolean shouldForceCascade)

INTERNAL: When merging from a clone when the cache cannot be guaranteed the object must be first read if it is existing and not in the cache.

public void
registerRemovedNewObjectIfRequired(Object removedObject)

Determine if the object is a registered new object, and that this is a nested unit of work merge into the parent.

public void
setCascadePolicy(int cascadePolicy)

public void
setForceCascade(boolean forceCascade)

public void
setForRefresh(boolean
the isForMerge to set
isforRefresh
)

public void
setLockThread(Thread lockThread)

INTERNAL: Save the currentThread for later comparison to the activeThread in case they don't match

protected void
setMergePolicy(int mergePolicy)

public void
protected void
public void
setQueueNode(LinkedNode node)

INTENRAL: Used to set the node that this merge manager is stored in, within the WriteLocksManager write lockers queue

protected void
public void
setWriteLockQueued(Object primaryKey)

INTENRAL: Used to set the object that the merge manager is waiting on, in order to acquire locks If this value is null then the merge manager is not waiting on any locks.

public boolean
shouldCascadeAllParts()

Flag used to determine if all parts should be cascaded

public boolean
shouldCascadeByMapping()

Flag used to determine that the mappings should be checked for cascade requirements.

public boolean
shouldCascadeParts()

Flag used to determine if any parts should be cascaded

public boolean
shouldCascadePrivateParts()

Flag used to determine if any private parts should be cascaded

public boolean
shouldCascadeReferences()

Refreshes are based on the objects row, so all attributes of the object must be refreshed.

public boolean
shouldForceCascade()

This is used to cascade merge even if a clone is already registered.

public boolean
shouldMergeChangesIntoDistributedCache()

INTERNAL: This happens when changes from an UnitOfWork is propagated to a distributed class.

public boolean
shouldMergeCloneIntoWorkingCopy()

This can be used by the user for merging clones from RMI into the unit of work.

public boolean
shouldMergeCloneWithReferencesIntoWorkingCopy()

This can be used by the user for merging remote EJB objects into the unit of work.

public boolean
shouldMergeOriginalIntoWorkingCopy()

This is used to revert changes to objects, or during refreshes.

public boolean
shouldMergeWorkingCopyIntoOriginal()

This is used during the unit of work commit to merge changes into the parent.

public boolean
shouldMergeWorkingCopyIntoRemote()

INTERNAL: This happens when serialized remote unit of work has to be merged with local remote unit of work.

public boolean
shouldRefreshRemoteObject()

INTERNAL: This is used to refresh objects on the remote session

public void
transitionToDeferredLocks()

INTERNAL: Records that this merge manager has transitioned to use deferred locks during the merge.

protected void
updateCacheKeyProperties(UnitOfWorkImpl unitOfWork, CacheKey cacheKey, Object original, Object clone, ObjectChangeSet objectChangeSet, ClassDescriptor descriptor)

INTERNAL: Update CacheKey properties with new information.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

acquiredLocksback to summary
protected ArrayList<CacheKey> acquiredLocks

Used to store the list of locks that this merge manager has acquired for this merge

CASCADE_ALL_PARTSback to summary
public static final int CASCADE_ALL_PARTS
CASCADE_BY_MAPPINGback to summary
public static final int CASCADE_BY_MAPPING
CASCADE_PRIVATE_PARTSback to summary
public static final int CASCADE_PRIVATE_PARTS
cascadePolicyback to summary
protected int cascadePolicy

Policy that determines how the merge will cascade to its object's parts.

CHANGES_INTO_DISTRIBUTED_CACHEback to summary
protected static final int CHANGES_INTO_DISTRIBUTED_CACHE
CLONE_INTO_WORKING_COPYback to summary
protected static final int CLONE_INTO_WORKING_COPY
CLONE_WITH_REFS_INTO_WORKING_COPYback to summary
protected static final int CLONE_WITH_REFS_INTO_WORKING_COPY
forceCascadeback to summary
protected boolean forceCascade

Force cascade merge even if a clone is already registered

isForRefreshback to summary
protected boolean isForRefresh

records that this merge process is for a refresh

isTransitionedToDeferredLocksback to summary
protected boolean isTransitionedToDeferredLocks

records that deferred locks have been employed for the merge process

LOCK_ON_MERGEback to summary
public static boolean LOCK_ON_MERGE

Backdoor to disable merge locks.

lockThreadback to summary
protected Thread lockThread

save the currentThread for later comparison to the activeThread in case they don't match

mergedNewObjectsback to summary
protected IdentityHashMap<Object, Object> mergedNewObjects

Used to keep track of merged new objects.

mergePolicyback to summary
protected int mergePolicy

Policy that determines merge type (i.e. merge is used for several usages).

NO_CASCADEback to summary
public static final int NO_CASCADE
objectDescriptorsback to summary
protected Map<Object, ObjectDescriptor> objectDescriptors

Used only while refreshing objects on remote session

objectsAlreadyMergedback to summary
protected Map<AbstractSession, Map<Object, Object>> objectsAlreadyMerged

Used to unravel recursion.

ORIGINAL_INTO_WORKING_COPYback to summary
protected static final int ORIGINAL_INTO_WORKING_COPY
queueNodeback to summary
protected LinkedNode queueNode

Stores the node that holds this mergemanager within the WriteLocksManager queue

REFRESH_REMOTE_OBJECTback to summary
protected static final int REFRESH_REMOTE_OBJECT
sessionback to summary
protected AbstractSession session

The unit of work merging for.

systemTimeback to summary
protected long systemTime

Stored so that all objects merged by a merge manager can have the same readTime.

WORKING_COPY_INTO_ORIGINALback to summary
protected static final int WORKING_COPY_INTO_ORIGINAL
WORKING_COPY_INTO_REMOTEback to summary
protected static final int WORKING_COPY_INTO_REMOTE
writeLockQueuedback to summary
protected Object writeLockQueued

If this variable is not null then the mergemanager is waiting on a particular primary key

Constructor Detail

MergeManagerback to summary
public MergeManager(AbstractSession session)

Method Detail

cascadeAllPartsback to summary
public void cascadeAllParts()

Cascade all parts, this is the default for the merge.

cascadePrivatePartsback to summary
public void cascadePrivateParts()

Cascade private parts, this can be used to merge clone when using RMI.

checkNewObjectLockVersionback to summary
public void checkNewObjectLockVersion(Object clone, Object primaryKey, ClassDescriptor descriptor, UnitOfWorkImpl unitOfWork)

Check if the new object's version has been set, if so, then it was an existing object that was deleted. Raise an error instead of reincarnating the object.

dontCascadePartsback to summary
public void dontCascadeParts()

Merge only direct parts, this can be used to merge clone when using RMI.

getAcquiredLocksback to summary
public ArrayList<CacheKey> getAcquiredLocks()
getCascadePolicyback to summary
public int getCascadePolicy()
getLockThreadback to summary
public Thread getLockThread()

INTERNAL:

Returns:Thread

lockThread

getMergedNewObjectsback to summary
public IdentityHashMap<Object, Object> getMergedNewObjects()

INTERNAL: Used to return a map containing new objects found through the registerObjectForMergeCloneIntoWorkingCopy method.

Returns:IdentityHashMap<Object, Object>

Map

getMergedObjectback to summary
public Object getMergedObject(Object key, AbstractSession targetSession)
getMergePolicyback to summary
protected int getMergePolicy()
getObjectDescriptorsback to summary
public Map<Object, ObjectDescriptor> getObjectDescriptors()
getObjectsAlreadyMergedback to summary
public Map<AbstractSession, Map<Object, Object>> getObjectsAlreadyMerged()
getObjectToMergeback to summary
public Object getObjectToMerge(Object sourceValue, ClassDescriptor descriptor, AbstractSession targetSession)
getQueueNodeback to summary
public LinkedNode getQueueNode()

INTENRAL: Used to get the node that this merge manager is stored in, within the WriteLocksManager write lockers queue

getSessionback to summary
public AbstractSession getSession()
getSystemTimeback to summary
public long getSystemTime()

Get the stored value of the current time. This method lazily initializes so that read times for the same merge manager can all be set to the same read time

getTargetVersionOfSourceObjectback to summary
public Object getTargetVersionOfSourceObject(Object source, ClassDescriptor descriptor, AbstractSession targetSession)

Return the corresponding value that should be assigned to the target object for the source object. This value must be local to the targets object space.

getWriteLockQueuedback to summary
public Object getWriteLockQueued()

INTENRAL: Used to get the object that the merge manager is waiting on, in order to acquire locks

isAlreadyMergedback to summary
public boolean isAlreadyMerged(Object object, AbstractSession targetSession)
isForRefreshback to summary
public boolean isForRefresh()
Returns:boolean

the isForMerge

isTransitionedToDeferredLocksback to summary
public boolean isTransitionedToDeferredLocks()

INTERNAL: Will return if the merge process has transitioned the active merge locks to deferred locks for readlock deadlock avoidance.

mergeChangesback to summary
public Object mergeChanges(Object object, ObjectChangeSet objectChangeSet, AbstractSession targetSession) throws ValidationException

Recursively merge changes in the object dependent on the merge policy. The map is used to resolve recursion.

mergeChangesForRefreshingRemoteObjectback to summary
protected Object mergeChangesForRefreshingRemoteObject(Object serverSideDomainObject)

Recursively merge the RMI clone from the server into the client unit of work working copy. This will only be called if the working copy exists.

mergeChangesFromChangeSetback to summary
public void mergeChangesFromChangeSet(UnitOfWorkChangeSet uowChangeSet)

INTERNAL: Merge the changes to all objects to session's cache.

mergeChangesIntoDistributedCacheback to summary
protected Object mergeChangesIntoDistributedCache(Object original, ObjectChangeSet changeSet)

Merge the changes specified within the changeSet into the cache. The object passed in is the original object from the cache.

mergeChangesOfCloneIntoWorkingCopyback to summary
protected Object mergeChangesOfCloneIntoWorkingCopy(Object rmiClone)

Recursively merge to rmi clone into the unit of work working copy. The map is used to resolve recursion.

mergeChangesOfOriginalIntoWorkingCopyback to summary
protected Object mergeChangesOfOriginalIntoWorkingCopy(Object clone)

Recursively merge to original from its parent into the clone. The map is used to resolve recursion.

mergeChangesOfWorkingCopyIntoOriginalback to summary
protected Object mergeChangesOfWorkingCopyIntoOriginal(Object clone, ObjectChangeSet objectChangeSet)

Recursively merge to clone into the original in its parent. The map is used to resolve recursion.

mergeChangesOfWorkingCopyIntoOriginalback to summary
protected CacheKey mergeChangesOfWorkingCopyIntoOriginal(Object clone, ObjectChangeSet objectChangeSet, ClassDescriptor descriptor, AbstractSession targetSession, UnitOfWorkImpl unitOfWork)

Recursively merge to clone into the original in its parent. The map is used to resolve recursion. This is used to merge objects from the unit of work into the shared (or isolated) cache.

mergeChangesOfWorkingCopyIntoRemoteback to summary
public Object mergeChangesOfWorkingCopyIntoRemote(Object clone) throws ValidationException

Recursively merge changes in the object dependent on the merge policy. This merges changes from a remote unit of work back from the server into the original remote unit of work. This is meant to merge server-side changes such as sequence numbers, version numbers or events triggered changes.

mergeCloneIntoWorkingCopyback to summary
public void mergeCloneIntoWorkingCopy()

This can be used by the user for merging clones from RMI into the unit of work.

mergeCloneWithReferencesIntoWorkingCopyback to summary
public void mergeCloneWithReferencesIntoWorkingCopy()

This is used during the merge of dependent objects referencing independent objects, where you want the independent objects merged as well.

mergeIntoDistributedCacheback to summary
public void mergeIntoDistributedCache()

This is used during cache synchronization to merge the changes into the distributed cache.

mergeNewObjectIntoCacheback to summary
public Object mergeNewObjectIntoCache(ObjectChangeSet changeSet)

Merge a change set for a new object into the cache. This method will create a shell for the new object and then merge the changes from the change set into the object. The newly merged object will then be added to the cache.

mergeOriginalIntoWorkingCopyback to summary
public void mergeOriginalIntoWorkingCopy()

This is used to revert changes to objects, or during refreshes.

mergeWorkingCopyIntoOriginalback to summary
public void mergeWorkingCopyIntoOriginal()

This is used during the unit of work commit to merge changes into the parent.

mergeWorkingCopyIntoRemoteback to summary
public void mergeWorkingCopyIntoRemote()

This is used during the unit of work commit to merge changes into the parent.

recordMergeback to summary
public void recordMerge(Object key, Object value, AbstractSession targetSession)
refreshRemoteObjectback to summary
public void refreshRemoteObject()

INTERNAL: This is used to refresh remote session object

registerExistingObjectOfReadOnlyClassInNestedTransactionback to summary
public Object registerExistingObjectOfReadOnlyClassInNestedTransaction(Object source, ClassDescriptor descriptor, AbstractSession targetSession)

INTERNAL: Used to register an existing object used in nested unit of work with read-only class in root unit of work.

registerObjectForMergeCloneIntoWorkingCopyback to summary
protected Object registerObjectForMergeCloneIntoWorkingCopy(Object clone, boolean shouldForceCascade)

INTERNAL: When merging from a clone when the cache cannot be guaranteed the object must be first read if it is existing and not in the cache. Otherwise no changes will be detected as the original state is missing.

registerRemovedNewObjectIfRequiredback to summary
public void registerRemovedNewObjectIfRequired(Object removedObject)

Determine if the object is a registered new object, and that this is a nested unit of work merge into the parent. In this case private mappings will register the object as being removed.

setCascadePolicyback to summary
public void setCascadePolicy(int cascadePolicy)
setForceCascadeback to summary
public void setForceCascade(boolean forceCascade)
setForRefreshback to summary
public void setForRefresh(boolean isforRefresh)
Parameters
isforRefresh:boolean

the isForMerge to set

setLockThreadback to summary
public void setLockThread(Thread lockThread)

INTERNAL: Save the currentThread for later comparison to the activeThread in case they don't match

setMergePolicyback to summary
protected void setMergePolicy(int mergePolicy)
setObjectDescriptorsback to summary
public void setObjectDescriptors(Map<Object, ObjectDescriptor> objectDescriptors)
setObjectsAlreadyMergedback to summary
protected void setObjectsAlreadyMerged(Map<AbstractSession, Map<Object, Object>> objectsAlreadyMerged)
setQueueNodeback to summary
public void setQueueNode(LinkedNode node)

INTENRAL: Used to set the node that this merge manager is stored in, within the WriteLocksManager write lockers queue

setSessionback to summary
protected void setSession(AbstractSession session)
setWriteLockQueuedback to summary
public void setWriteLockQueued(Object primaryKey)

INTENRAL: Used to set the object that the merge manager is waiting on, in order to acquire locks If this value is null then the merge manager is not waiting on any locks.

shouldCascadeAllPartsback to summary
public boolean shouldCascadeAllParts()

Flag used to determine if all parts should be cascaded

shouldCascadeByMappingback to summary
public boolean shouldCascadeByMapping()

Flag used to determine that the mappings should be checked for cascade requirements.

shouldCascadePartsback to summary
public boolean shouldCascadeParts()

Flag used to determine if any parts should be cascaded

shouldCascadePrivatePartsback to summary
public boolean shouldCascadePrivateParts()

Flag used to determine if any private parts should be cascaded

shouldCascadeReferencesback to summary
public boolean shouldCascadeReferences()

Refreshes are based on the objects row, so all attributes of the object must be refreshed. However merging from RMI, normally reference are made transient, so should not be merge unless specified.

shouldForceCascadeback to summary
public boolean shouldForceCascade()

This is used to cascade merge even if a clone is already registered.

shouldMergeChangesIntoDistributedCacheback to summary
public boolean shouldMergeChangesIntoDistributedCache()

INTERNAL: This happens when changes from an UnitOfWork is propagated to a distributed class.

shouldMergeCloneIntoWorkingCopyback to summary
public boolean shouldMergeCloneIntoWorkingCopy()

This can be used by the user for merging clones from RMI into the unit of work.

shouldMergeCloneWithReferencesIntoWorkingCopyback to summary
public boolean shouldMergeCloneWithReferencesIntoWorkingCopy()

This can be used by the user for merging remote EJB objects into the unit of work.

shouldMergeOriginalIntoWorkingCopyback to summary
public boolean shouldMergeOriginalIntoWorkingCopy()

This is used to revert changes to objects, or during refreshes.

shouldMergeWorkingCopyIntoOriginalback to summary
public boolean shouldMergeWorkingCopyIntoOriginal()

This is used during the unit of work commit to merge changes into the parent.

shouldMergeWorkingCopyIntoRemoteback to summary
public boolean shouldMergeWorkingCopyIntoRemote()

INTERNAL: This happens when serialized remote unit of work has to be merged with local remote unit of work.

shouldRefreshRemoteObjectback to summary
public boolean shouldRefreshRemoteObject()

INTERNAL: This is used to refresh objects on the remote session

transitionToDeferredLocksback to summary
public void transitionToDeferredLocks()

INTERNAL: Records that this merge manager has transitioned to use deferred locks during the merge.

updateCacheKeyPropertiesback to summary
protected void updateCacheKeyProperties(UnitOfWorkImpl unitOfWork, CacheKey cacheKey, Object original, Object clone, ObjectChangeSet objectChangeSet, ClassDescriptor descriptor)

INTERNAL: Update CacheKey properties with new information. This method is called if this code actually merges