use of org.apache.ignite.internal.processors.cache.store.CacheStoreManager in project ignite by apache.
the class IgniteTxLocalAdapter method userRollback.
/**
* {@inheritDoc}
*/
@Override
public void userRollback(boolean clearThreadMap) throws IgniteCheckedException {
TransactionState state = state();
if (state != ROLLING_BACK && state != ROLLED_BACK) {
setRollbackOnly();
throw new IgniteCheckedException("Invalid transaction state for rollback [state=" + state + ", tx=" + this + ']');
}
if (near()) {
// transaction manager, so they will be removed from cache.
for (IgniteTxEntry e : allEntries()) evictNearEntry(e, false);
}
if (DONE_FLAG_UPD.compareAndSet(this, 0, 1)) {
cctx.tm().rollbackTx(this, clearThreadMap, skipCompletedVersions());
cctx.mvccCaching().onTxFinished(this, false);
if (!internal()) {
Collection<CacheStoreManager> stores = txState.stores(cctx);
if (stores != null && !stores.isEmpty()) {
assert isWriteToStoreFromDhtValid(stores) : "isWriteToStoreFromDht can't be different within one transaction";
boolean isWriteToStoreFromDht = F.first(stores).isWriteToStoreFromDht();
if (!stores.isEmpty() && (near() || isWriteToStoreFromDht))
sessionEnd(stores, false);
}
}
}
}
Aggregations