Examples of TransactionState


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

                        if (interests != null && interests.size() > 0) {
                            boolean found = false;
                            for (int j = 0; j < interests.size(); j++) {
                                ConsumerUID intid = (ConsumerUID)interests.get(j);
                                if (intid.equals(id)) {
                                    TransactionState ts = translist.retrieveState(tid);
                                    if (ts != null && ts.getState() == TransactionState.FAILED) {
                                        found = true;
                                        break;
                                    }
                                }
                            }
View Full Code Here

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

                                   Globals.getPacketRouter(0).getHandler(
                                          PacketType.ROLLBACK_TRANSACTION);
            TransactionUID[] tuids = (TransactionUID[])conlist.toArray(new TransactionUID[0]);
            for (int i = 0; i < tuids.length; i ++) {
                tid = (TransactionUID) tuids[i];
                TransactionState ts = Globals.getTransactionList().retrieveState(tid);
                if (ts == null) {
                    // nothing to do if no transaction state
                    continue;
                }
                int tstate = ts.getState();
                if (ts.getXid() != null) {
                    if (xaretainall) {
                        if (!xaretainallLogged) {
                        logger.log(Logger.INFO, Globals.getBrokerResources().getKString(
                                   BrokerResources.I_CONN_CLEANUP_RETAIN_XA));
                        xaretainallLogged = true;
                        }
                        continue;
                    }
                    if(tstate > TransactionState.COMPLETE) {
                       String[] args = { ""+tid+"(XID="+ts.getXid()+")",
                                         TransactionState.toString(tstate),
                                         getConnectionUID().toString() };
                        logger.log(Logger.INFO, Globals.getBrokerResources().getKString(
                                          BrokerResources.I_CONN_CLEANUP_KEEP_TXN, args));
                        continue;
                    }
                    if (tstate == TransactionState.INCOMPLETE ||
                        tstate == TransactionState.COMPLETE ) {
                        ts.detachedFromConnection();
                        timeoutTIDs.add(tid);
                        String[] args = { ""+tid+"(XID="+ts.getXid()+")",
                                          TransactionState.toString(tstate),
                                          getConnectionUID().toString() };
                        logger.log(Logger.INFO, Globals.getBrokerResources().getKString(
                                          BrokerResources.I_CONN_CLEANUP_KEEP_TXN, args));
                        continue;
                    }
                }
                if (tstate == TransactionState.PREPARED ||
                    tstate == TransactionState.COMMITTED ||
                    tstate == TransactionState.ROLLEDBACK) {
                    String[] args = { ""+tid,
                                      TransactionState.toString(tstate),
                                      getConnectionUID().toString() };
                    logger.log(Logger.INFO, Globals.getBrokerResources().getKString(
                               BrokerResources.I_CONN_CLEANUP_KEEP_TXN, args));
                    continue;
                }
                if (DEBUG || DEBUG_TXN) {
                    logger.log(Logger.INFO, "Cleanup connection ["+getConnectionUID()+
                    "]: cleaning up transaction "+tid+"["+TransactionState.toString(tstate)+"]");
                }
                try {
                     rollbackHandler.doRollback(tid, ts.getXid(), null, ts, conlist,
                                   null, RollbackReason.CONNECTION_CLEANUP);
                } catch (Exception e) {
                     String[] args = { ""+tid+"["+TransactionState.toString(tstate)+"]",
                                       getConnectionUID().toString(), e.getMessage() };
                     logger.logStack(logger.WARNING,
View Full Code Here

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

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

        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

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

                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);
        } catch (RuntimeException e) {
            String msg = (txnInfo != null) ?
                id + " " + txnInfo.toString() : id.toString();
View Full Code Here

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

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

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

                tidMap.put(id, txnInfo);
            }
        } catch (Exception e) {
            logger.log(Logger.ERROR, BrokerResources.X_UPDATE_TXNSTATE_FAILED, id, e);
View Full Code Here

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

                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

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

            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

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

    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

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

        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) {
                    itr.remove();
                    removeTransactionAck(tid);
                }
            } catch (RuntimeException e) {
                error = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.