/** * @return {@code True} if updates should be batched up. */ protected boolean isBatchUpdate() { return storeEnabled && (implicit() || cctx.store().configured() && cctx.config().isBatchUpdateOnCommit()); }
/** * @return {@code True} if updates should be done individually. */ protected boolean isSingleUpdate() { return storeEnabled && !implicit() && cctx.store().configured() && !cctx.config().isBatchUpdateOnCommit(); }
/** * Checks transaction expiration. * * @param filter Optional array of filters to check for optimistic transactions. * @throws GridException If transaction failed. */ protected void checkValid(GridPredicate<GridCacheEntry<K, V>>[] filter) throws GridException { if (optimistic() && !cctx.config().isBatchUpdateOnCommit() && !F.isEmptyOrNulls(filter)) throw new GridException("Operations that receive non-empty predicate filters cannot be used for " + "optimistic mode if 'batchUpdateOnCommit' configuration flag is set to 'false': " + this); if (isRollbackOnly()) { if (timedOut()) throw new GridCacheTxTimeoutException("Cache transaction timed out: " + this); GridCacheTxState state = state(); if (state == ROLLING_BACK || state == ROLLED_BACK) throw new GridCacheTxRollbackException("Cache transaction is marked as rollback-only " + "(will be rolled back automatically): " + this); if (state == UNKNOWN) throw new GridCacheTxHeuristicException("Cache transaction is in unknown state " + "(remote transactions will be invalidated): " + this); throw new GridException("Cache transaction marked as rollback-only: " + this); } if (remainingTime() == 0 && setRollbackOnly()) throw new GridCacheTxTimeoutException("Cache transaction timed out " + "(was rolled back automatically): " + this); }
swapEnabled = cfg.isSwapEnabled(); ttl = cfg.getDefaultTimeToLive(); txBatchUpdate = cfg.isBatchUpdateOnCommit(); txSerEnabled = cfg.isTxSerializableEnabled(); writeBehindBatchSize = cfg.getWriteBehindBatchSize();
cfg.swapEnabled(ccfg.isSwapEnabled()); cfg.queryIndexEnabled(ccfg.isQueryIndexEnabled()); cfg.batchUpdateOnCommit(ccfg.isBatchUpdateOnCommit()); cfg.invalidate(ccfg.isInvalidate()); cfg.startSize(ccfg.getStartSize());
tmLookupClsName = cc.getTransactionManagerLookupClassName(); ttl = cc.getDefaultTimeToLive(); txBatchUpdate = cc.isBatchUpdateOnCommit(); txSerEnabled = cc.isTxSerializableEnabled(); writeBehindBatchSize = cc.getWriteBehindBatchSize();