/** {@inheritDoc} */ public int getTerracottaClusteredSize() { try { Transaction transaction = transactionManagerLookup.getTransactionManager().getTransaction(); if (transaction == null) { return underlyingStore.getTerracottaClusteredSize(); } } catch (SystemException se) { throw new TransactionException("cannot get the current transaction", se); } LOG.debug("cache {} getTerracottaClusteredSize", cache.getName()); XATransactionContext context = getOrCreateTransactionContext(); int size = underlyingStore.getTerracottaClusteredSize(); return size + context.getSizeModifier(); }
/** {@inheritDoc} */ public int getSize() { LOG.debug("cache {} getSize", cache.getName()); XATransactionContext context = getOrCreateTransactionContext(); int size = underlyingStore.getSize(); return Math.max(0, size + context.getSizeModifier()); }