Examples of TransactionInfo


Examples of com.persistit.Management.TransactionInfo

        stat("jread").update(time, info.getReadPageCount());
        stat("jcopy").update(time, info.getCopiedPageCount());
    }

    private void updateTransactionStatistics(final Management management, final long time) throws Exception {
        final TransactionInfo info = management.getTransactionInfo();
        stat("tcommit").update(time, info.getCommitCount());
        stat("troll").update(time, info.getRollbackCount());
    }
View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.persist.TransactionInfo

        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.persist.TransactionInfo

     * @exception NullPointerException  if <code>id</code> is <code>null</code>
     */
    public void storeClusterTransaction(TransactionUID id, TransactionState ts,
        TransactionBroker[] brokers, boolean sync) throws BrokerException {

        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,
                    BrokerResources.E_TRANSACTIONID_EXISTS_IN_STORE, id);
                throw new BrokerException(br.getString(
                    BrokerResources.E_TRANSACTIONID_EXISTS_IN_STORE, id));
            }
        } catch (RuntimeException e) {
            String msg = (txnInfo != null) ?
                id + " " + txnInfo.toString() : id.toString();
            logger.log(Logger.ERROR,
                BrokerResources.X_PERSIST_TRANSACTION_FAILED, msg, e);
            throw new BrokerException(br.getString(
                BrokerResources.X_PERSIST_TRANSACTION_FAILED, msg), e);
        }
View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.persist.TransactionInfo

     */
    public void storeRemoteTransaction(TransactionUID id, TransactionState ts,
        TransactionAcknowledgement[] acks, BrokerAddress txnHomeBroker,
        boolean sync) throws BrokerException {

        TransactionInfo txnInfo = null;
        boolean removedAcksFlag = false;
        try {
            if (tidMap.containsKey(id)) {
                logger.log(Logger.ERROR,
                    BrokerResources.E_TRANSACTIONID_EXISTS_IN_STORE, id);
                throw new BrokerException(br.getString(
                    BrokerResources.E_TRANSACTIONID_EXISTS_IN_STORE, id));
            }

            // We must store the acks first if provided
            if (acks != null && acks.length > 0) {
                storeTransactionAcks(id, acks);
                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();
            logger.log(Logger.ERROR,
                BrokerResources.X_PERSIST_TRANSACTION_FAILED, msg, e);

            try {
                if (removedAcksFlag) {
View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.persist.TransactionInfo

     */
    void updateTransactionState(TransactionUID id, int ts, boolean sync)
  throws IOException, BrokerException {

        try {
            TransactionInfo txnInfo = (TransactionInfo)tidMap.get(id);
            if (txnInfo == null) {
                logger.log(Logger.ERROR,
                    BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id);
                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);
            }
View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.persist.TransactionInfo

     */
    public void updateClusterTransaction(TransactionUID id,
        TransactionBroker[] brokers, boolean sync) throws BrokerException {

        try {
            TransactionInfo txnInfo = (TransactionInfo)tidMap.get(id);
            if (txnInfo == null) {
                logger.log(Logger.ERROR,
                    BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id);
                throw new BrokerException(br.getString(
                    BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id),
                    Status.NOT_FOUND);
            }

            txnInfo.setType(TransactionInfo.TXN_CLUSTER);
            txnInfo.setTransactionBrokers(brokers);

            tidMap.put(id, txnInfo);
        } catch (RuntimeException e) {
            logger.log(Logger.ERROR, BrokerResources.X_PERSIST_TRANSACTION_FAILED, id, e);
            throw new BrokerException(
View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.persist.TransactionInfo

     */
    void updateTransactionBrokerState(TransactionUID id, int expectedTxnState,
        TransactionBroker txnBkr, boolean sync) throws BrokerException {

        try {
            TransactionInfo txnInfo = (TransactionInfo)tidMap.get(id);

            if (txnInfo == null) {
                logger.log(Logger.ERROR,
                    BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id);
                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);

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

Examples of com.sun.messaging.jmq.jmsserver.persist.TransactionInfo

     * @exception com.sun.messaging.jmq.jmsserver.util.BrokerException if the transaction id is not in the store
     */
    TransactionState getTransactionState(TransactionUID id)
        throws BrokerException {

        TransactionInfo txnInfo = (TransactionInfo)tidMap.get(id);

        if (txnInfo == null) {
            logger.log(Logger.ERROR,
                BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id);
            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.persist.TransactionInfo

     * @param id id of the transaction
     */
    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();
            }
        }

View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.persist.TransactionInfo

     * @exception com.sun.messaging.jmq.jmsserver.util.BrokerException if the transaction id is not in the store
     */
    TransactionInfo getTransactionInfo(TransactionUID id)
        throws BrokerException {

        TransactionInfo txnInfo = (TransactionInfo)tidMap.get(id);

        if (txnInfo == null) {
            logger.log(Logger.ERROR,
                BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id);
            throw new BrokerException(br.getString(
                BrokerResources.E_TRANSACTIONID_NOT_FOUND_IN_STORE, id),
                Status.NOT_FOUND);
        }

        return (TransactionInfo)txnInfo.clone();
    }
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.