Package org.gridgain.grid.cache

Examples of org.gridgain.grid.cache.GridCacheTxState


        if (optimistic())
            state(PREPARED);

        if (commit) {
            if (!state(COMMITTING)) {
                GridCacheTxState state = state();

                if (state != COMMITTING && state != COMMITTED)
                    throw new GridException("Invalid transaction state for commit [state=" + state() +
                        ", tx=" + this + ']');
                else {
View Full Code Here


        if (log.isDebugEnabled())
            log.debug("Finishing near local tx [tx=" + this + ", commit=" + commit + "]");

        if (commit) {
            if (!state(COMMITTING)) {
                GridCacheTxState state = state();

                if (state != COMMITTING && state != COMMITTED)
                    throw new GridException("Invalid transaction state for commit [state=" + state() +
                        ", tx=" + this + ']');
                else {
View Full Code Here

     * @return {@code True} if transaction was salvaged by this call.
     */
    private boolean salvageTx(GridCacheTxEx<K, V> tx, boolean warn, GridCacheTxEx.FinalizationStatus status) {
        assert tx != null;

        GridCacheTxState state = tx.state();

        if (state == ACTIVE || state == PREPARING || state == PREPARED) {
            try {
                if (!tx.markFinalizing(status)) {
                    if (log.isDebugEnabled())
View Full Code Here

                    res.add(tx.finishFuture());
            }
            else if (tx.concurrency() == OPTIMISTIC) {
                // For OPTIMISTIC mode we wait only for txs in PREPARING state that
                // have keys for given partitions.
                GridCacheTxState state = tx.state();
                long txTopVer = tx.topologyVersion();

                if ((state == PREPARING || state == PREPARED || state == COMMITTING)
                    && txTopVer > 0 && txTopVer < topVer) {
                    if (cctx.hasKey(tx.readSet(), parts) || cctx.hasKey(tx.writeSet(), parts))
View Full Code Here

        for (Map.Entry<GridCacheVersion, GridCacheTxEx<K, V>> e : idMap.entrySet()) {
            GridCacheTxEx<K, V> tx = e.getValue();

            if (nearVer.equals(tx.nearXidVersion())) {
                GridCacheTxState state = tx.state();

                if (state == PREPARED || state == COMMITTING || state == COMMITTED) {
                    if (--txNum == 0)
                        return true;
                }
View Full Code Here

TOP

Related Classes of org.gridgain.grid.cache.GridCacheTxState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.