/**
* Create the identity map for the unit of work.
* PERF: UOW uses a special map to avoid locks, always full, and can use special weak refs.
*/
public IdentityMap buildNewIdentityMapForUnitOfWork(UnitOfWorkImpl unitOfwork, ClassDescriptor descriptor) {
ReferenceMode mode = unitOfwork.getReferenceMode();
if (mode == ReferenceMode.FORCE_WEAK) {
return new WeakUnitOfWorkIdentityMap(32, descriptor);
} else if ((mode == ReferenceMode.WEAK)
// Only allow weak if using change tracking.
&& descriptor.getObjectChangePolicy().isAttributeChangeTrackingPolicy()) {