Examples of XATransaction


Examples of com.taobao.metamorphosis.server.transaction.XATransaction

    public TransactionId[] getPreparedTransactions(final SessionContext context, final String uniqueQualifier)
            throws Exception {
        final List<TransactionId> txs = new ArrayList<TransactionId>();
        synchronized (this.xaTransactions) {
            for (final Iterator<XATransaction> iter = this.xaTransactions.values().iterator(); iter.hasNext();) {
                final XATransaction tx = iter.next();
                // Only tx that the unique qualifier is equals to the request
                // one.
                if (tx.isPrepared() && this.isValidTx(uniqueQualifier, tx)) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("prepared transaction: " + tx.getTransactionId());
                    }
                    txs.add(tx.getTransactionId());
                }
            }
        }
        synchronized (this.xaHeuristicTransactions) {
            // �ֹ���������񣬶���prepare״̬��xa����
            for (final Iterator<XATransaction> iter = this.xaHeuristicTransactions.values().iterator(); iter.hasNext();) {
                final XATransaction tx = iter.next();
                // Only tx that the unique qualifier is equals to the request
                // one.
                if (this.isValidTx(uniqueQualifier, tx)) {
                    txs.add(tx.getTransactionId());
                }
            }
        }
        final XATransactionId rc[] = new XATransactionId[txs.size()];
        txs.toArray(rc);
View Full Code Here

Examples of com.taobao.metamorphosis.server.transaction.XATransaction

            synchronized (this.xaTransactions) {
                transaction = this.xaTransactions.get(xid);
                if (transaction != null) {
                    return;
                }
                transaction = new XATransaction(this, this.transactionStore, (XATransactionId) xid);
                this.xaTransactions.put(xid, (XATransaction) transaction);
            }
        }
        else {
            this.statsManager.statsTxBegin(false, 1);
View Full Code Here

Examples of org.apache.activemq.transaction.XATransaction

    }

    public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception {
        // the transaction may have already been started.
        if (xid.isXATransaction()) {
            XATransaction transaction = null;
            synchronized (xaTransactions) {
                transaction = xaTransactions.get(xid);
                if (transaction != null) {
                    return;
                }
                transaction = new XATransaction(transactionStore, (XATransactionId)xid, this, context.getConnectionId());
                xaTransactions.put(xid, transaction);
            }
        } else {
            Map<TransactionId, Transaction> transactionMap = context.getTransactions();
            Transaction transaction = transactionMap.get(xid);
View Full Code Here

Examples of org.apache.activemq.transaction.XATransaction

            consumerExchange.setConnectionContext(context);
            transactionStore.recover(new TransactionRecoveryListener() {
                public void recover(XATransactionId xid, Message[] addedMessages, MessageAck[] aks) {
                    try {
                        beginTransaction(context, xid);
                        XATransaction transaction = (XATransaction) getTransaction(context, xid, false);
                        for (int i = 0; i < addedMessages.length; i++) {
                            forceDestinationWakeupOnCompletion(context, transaction, addedMessages[i].getDestination(), addedMessages[i]);
                        }
                        for (int i = 0; i < aks.length; i++) {
                            forceDestinationWakeupOnCompletion(context, transaction, aks[i].getDestination(), aks[i]);
                        }
                        transaction.setState(Transaction.PREPARED_STATE);
                        registerMBean(transaction);
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("recovered prepared transaction: " + transaction.getTransactionId());
                        }
                    } catch (Throwable e) {
                        throw new WrappedException(e);
                    }
                }
View Full Code Here

Examples of org.apache.activemq.transaction.XATransaction

    }

    public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception {
        // the transaction may have already been started.
        if (xid.isXATransaction()) {
            XATransaction transaction = null;
            synchronized (xaTransactions) {
                transaction = xaTransactions.get(xid);
                if (transaction != null) {
                    return;
                }
                transaction = new XATransaction(transactionStore, (XATransactionId)xid, this, context.getConnectionId());
                xaTransactions.put(xid, transaction);
            }
        } else {
            Map<TransactionId, Transaction> transactionMap = context.getTransactions();
            Transaction transaction = transactionMap.get(xid);
View Full Code Here

Examples of org.apache.activemq.transaction.XATransaction

    }

    public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception {
        // the transaction may have already been started.
        if (xid.isXATransaction()) {
            XATransaction transaction = null;
            synchronized (xaTransactions) {
                transaction = xaTransactions.get(xid);
                if (transaction != null) {
                    return;
                }
                transaction = new XATransaction(transactionStore, (XATransactionId)xid, this, context.getConnectionId());
                xaTransactions.put(xid, transaction);
            }
        } else {
            Map<TransactionId, Transaction> transactionMap = context.getTransactions();
            Transaction transaction = transactionMap.get(xid);
View Full Code Here

Examples of org.apache.activemq.transaction.XATransaction

            synchronized (xaTransactions) {
                transaction = xaTransactions.get(xid);
                if (transaction != null) {
                    return;
                }
                transaction = new XATransaction(transactionStore, (XATransactionId)xid, this);
                xaTransactions.put(xid, transaction);
            }
        } else {
            Map<TransactionId, Transaction> transactionMap = context.getTransactions();
            Transaction transaction = transactionMap.get(xid);
View Full Code Here

Examples of org.apache.activemq.transaction.XATransaction

        // the transaction may have already been started.
        if( xid.isXATransaction() ) {
            Transaction transaction = (Transaction)xaTransactions.get(xid);
            if( transaction != null  )
                return;
            transaction = new XATransaction(transactionStore, (XATransactionId)xid, this);
            xaTransactions.put(xid, transaction);
        } else {
            Map transactionMap = context.getTransactions();       
            Transaction transaction = (Transaction)transactionMap.get(xid);
            if( transaction != null  )
View Full Code Here

Examples of org.apache.activemq.transaction.XATransaction

            consumerExchange.setConnectionContext(context);
            transactionStore.recover(new TransactionRecoveryListener() {
                public void recover(XATransactionId xid, Message[] addedMessages, MessageAck[] aks) {
                    try {
                        beginTransaction(context, xid);
                        XATransaction transaction = (XATransaction) getTransaction(context, xid, false);
                        for (int i = 0; i < addedMessages.length; i++) {
                            forceDestinationWakeupOnCompletion(context, transaction, addedMessages[i].getDestination(), addedMessages[i]);
                        }
                        for (int i = 0; i < aks.length; i++) {
                            forceDestinationWakeupOnCompletion(context, transaction, aks[i].getDestination(), aks[i]);
                        }
                        transaction.setState(Transaction.PREPARED_STATE);
                        registerMBean(transaction);
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("recovered prepared transaction: " + transaction.getTransactionId());
                        }
                    } catch (Throwable e) {
                        throw new WrappedException(e);
                    }
                }
View Full Code Here

Examples of org.apache.activemq.transaction.XATransaction

    }

    public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception {
        // the transaction may have already been started.
        if (xid.isXATransaction()) {
            XATransaction transaction = null;
            synchronized (xaTransactions) {
                transaction = xaTransactions.get(xid);
                if (transaction != null) {
                    return;
                }
                transaction = new XATransaction(transactionStore, (XATransactionId)xid, this, context.getConnectionId());
                xaTransactions.put(xid, transaction);
            }
        } else {
            Map<TransactionId, Transaction> transactionMap = context.getTransactions();
            Transaction transaction = transactionMap.get(xid);
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.