if (cacheEntry == null) {
cacheEntry = existing == null ? getFromContainer(key, false) : existing;
// do not bother wrapping though if this is not in a tx. repeatable read etc are all meaningless unless there is a tx.
if (useRepeatableRead) {
MVCCEntry mvccEntry;
if (cacheEntry == null) {
mvccEntry = createWrappedEntry(key, null, ctx, null, false, false, false);
} else {
mvccEntry = createWrappedEntry(key, cacheEntry, ctx, null, false, false, false);
// If the original entry has changeable state, copy state flags to the new MVCC entry.
if (cacheEntry instanceof StateChangingEntry && mvccEntry != null)
mvccEntry.copyStateFlagsFrom((StateChangingEntry) cacheEntry);
}
if (mvccEntry != null) ctx.putLookedUpEntry(key, mvccEntry);
if (trace) {
log.tracef("Wrap %s for read. Entry=%s", key, mvccEntry);