Package com.sun.messaging.jmq.jmsserver.data

Examples of com.sun.messaging.jmq.jmsserver.data.TransactionState


        try {
            // TransactionState is mutable, so we must store a copy
            // See bug 4989708
            Object oldValue = tidMap.putIfAbsent(
                id, new TransactionInfo(new TransactionState(ts)));

            if (oldValue != null) {
                logger.log(Logger.ERROR,
                    BrokerResources.E_TRANSACTIONID_EXISTS_IN_STORE, id);
                throw new BrokerException(br.getString(
View Full Code Here


        TransactionInfo txnInfo = null;
        try {
            // TransactionState is mutable, so we must store a copy
            // See bug 4989708
            txnInfo = new TransactionInfo(new TransactionState(ts), null,
                brokers, TransactionInfo.TXN_CLUSTER);

            Object oldValue = tidMap.putIfAbsent(id, txnInfo);
            if (oldValue != null) {
                logger.log(Logger.ERROR,
View Full Code Here

                removedAcksFlag = true;
            }

            // Now we store the txn;
            // TransactionState is mutable, so we must store a copy
            txnInfo = new TransactionInfo(new TransactionState(ts), txnHomeBroker,
                    null, TransactionInfo.TXN_REMOTE);
            tidMap.put(id, txnInfo);

            if (sync) {
                sync(id);
View Full Code Here

                throw new BrokerException(
                    br.getString(br.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id),
                    Status.NOT_FOUND);
            }

            TransactionState txnState = txnInfo.getTransactionState();
            if (txnState.getState() != ts) {
                txnState.setState(ts);

                if (updateOptimization) {
                    // To improve I/O performance, just persist the new
                    // state as client data and not the whole record
                    byte[] cd = generateClientData(id, txnInfo);
View Full Code Here

                throw new BrokerException(br.getString(
                    BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id),
                    Status.NOT_FOUND);
            }

            TransactionState txnState = txnInfo.getTransactionState();
            if (txnState.getState() != expectedTxnState) {
                Object[] args = { txnBkr, id,
                    TransactionState.toString(expectedTxnState),
                    TransactionState.toString(txnState.getState()) };
                throw new BrokerException(br.getKString( BrokerResources.E_UPDATE_TXNBROKER_FAILED,
                    args ), Status.CONFLICT);
            }

            txnInfo.updateBrokerState(txnBkr);
View Full Code Here

            throw new BrokerException(br.getString(
                BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id),
                Status.NOT_FOUND);
        }

        return new TransactionState(txnInfo.getTransactionState());
    }
View Full Code Here

    int getTransactionStateValue(TransactionUID id)
        throws BrokerException {

        TransactionInfo txnInfo = (TransactionInfo)tidMap.get(id);
        if (txnInfo != null) {
            TransactionState txnState = txnInfo.getTransactionState();
            if (txnState != null) {
                return txnState.getState();
            }
        }

        return TransactionState.NULL;
    }   
View Full Code Here

        while (itr.hasNext()) {
            Map.Entry entry = (Map.Entry)itr.next();
            TransactionInfo txnInfo = (TransactionInfo)entry.getValue();
            int type = txnInfo.getType();
            if (type == TransactionInfo.TXN_REMOTE) {
                map.put(entry.getKey(), (new TransactionState(txnInfo.getTransactionState())));
            }
        }

        return map;
    }
View Full Code Here

        Iterator itr = tidMap.entrySet().iterator();
        while (itr.hasNext()) {
            try {
                Map.Entry entry = (Map.Entry)itr.next();
                TransactionUID tid = (TransactionUID)entry.getKey();
                TransactionState ts = (TransactionState)entry.getValue();
                // Remove if not in prepared state
                    if (ts.getState() != state) {
                    // XXX PERF 12/7/2001 This operation updates disk
                    // with every call.
                    itr.remove();
                    try {
                        txnAckList.removeAcks(tid, sync);
View Full Code Here

        Iterator itr = tidMap.entrySet().iterator();
        while (itr.hasNext()) {
            Throwable ex = null;
            Map.Entry entry = (Map.Entry)itr.next();
            Object key = entry.getKey();
            TransactionState value = (TransactionState)entry.getValue();
            byte[] cData = null;
            try {
                cData = ((PHashMapMMF)tidMap).getClientData(key);
                if (cData != null && cData.length > 0) {
                    int state = (int)cData[0]; // 1st byte is the modified state
                    value.setState(state);     // update txn state
                }
            } catch (Throwable e) {
                ex = e;
            }
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.data.TransactionState

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.