// PERF: Allow the session cached to still be used after early transaction if isolation setting has been set.
CachePolicy cachePolicy = concreteDescriptor.getCachePolicy();
if (!cachePolicy.shouldUseSessionCacheInUnitOfWorkEarlyTransaction()) {
if (((unitOfWork.hasCommitManager() && unitOfWork.getCommitManager().isActive())
|| unitOfWork.wasTransactionBegunPrematurely()
|| cachePolicy.shouldIsolateObjectsInUnitOfWork()
|| cachePolicy.shouldIsolateProtectedObjectsInUnitOfWork()
|| query.shouldStoreBypassCache())
&& (!unitOfWork.isClassReadOnly(concreteDescriptor.getJavaClass(), concreteDescriptor))) {
// It is easier to switch once to the correct builder here.
return concreteDescriptor.getObjectBuilder().buildWorkingCopyCloneFromRow(query, joinManager, databaseRow, unitOfWork, primaryKey, preFetchedCacheKey);