return new CoarseSessionEntry<>(entry, (existingValue != null) ? existingValue : value);
}
@Override
public CoarseSessionEntry<L> findValue(String id) {
TransactionConfiguration transaction = this.sessionCache.getCacheConfiguration().transaction();
boolean pessimistic = transaction.transactionMode().isTransactional() && (transaction.lockingMode() == LockingMode.PESSIMISTIC);
Cache<String, CoarseSessionCacheEntry<L>> cache = pessimistic ? this.sessionCache.getAdvancedCache().withFlags(Flag.FORCE_WRITE_LOCK) : this.sessionCache;
CoarseSessionCacheEntry<L> entry = cache.get(id);
if (entry == null) return null;
MarshalledValue<Map<String, Object>, MarshallingContext> value = this.attributesCache.get(new SessionAttributesCacheKey(id));
return new CoarseSessionEntry<>(entry, value);