// ELBug 355610 - Use appendLock() instead of acquireLock() for transitioning
// to deferred locks for new objects in order to avoid the possibility of a deadlock.
cacheKey = session.getIdentityMapAccessorInstance().getWriteLockManager().appendLock(primaryKey, original, descriptor, this, session);
}
descriptor.getObjectBuilder().mergeChangesIntoObject(original, changeSet, null, this, session, false, false);
if (descriptor.usesOptimisticLocking() && descriptor.getOptimisticLockingPolicy().isStoredInCache()) {
cacheKey.setWriteLockValue(changeSet.getWriteLockValue());
}
cacheKey.setObject(original);
if (descriptor.getCacheInvalidationPolicy().shouldUpdateReadTimeOnUpdate() || changeSet.isNew()) {
cacheKey.setReadTime(getSystemTime());