private Element getCurrentElement(final Object key, final XATransactionContext context) { Element previous = context.get(key); if (previous == null && !context.isRemoved(key)) { previous = getQuietFromUnderlyingStore(key); } return previous; }
/** {@inheritDoc} */ public Element getQuiet(Object key) { LOG.debug("cache {} getQuiet {}", cache.getName(), key); XATransactionContext context = getTransactionContext(); Element element; if (context == null) { element = getQuietFromUnderlyingStore(key); } else { element = context.get(key); if (element == null && !context.isRemoved(key)) { element = getQuietFromUnderlyingStore(key); } } return copyElementForRead(element); }
private boolean internalPut(final StorePutCommand putCommand) { final Element element = putCommand.getElement(); boolean isNull; if (element == null) { return true; } XATransactionContext context = getOrCreateTransactionContext(); // In case this key is currently being updated... isNull = underlyingStore.get(element.getKey()) == null; if (isNull) { isNull = context.get(element.getKey()) == null; } context.addCommand(putCommand, element); return isNull; }