Examples of TransactionState


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

                    dbuf.append("\n\t"+tas[i]);
                    }
                }
                if (ae != null) throw ae;

                TransactionState ts = new TransactionState();
                ts.setState(TransactionState.PREPARED);
                if (DEBUG_CLUSTER_TXN) {
                logger.log(logger.INFO, "Preparing remote transaction "+tid + " from "+txnHomeBroker+dbuf.toString());
                }
                Globals.getTransactionList().logRemoteTransaction(tid, ts, tas,
                                       txnHomeBroker, false, true, true);
View Full Code Here

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

                 com.sun.messaging.jmq.jmsserver.core.BrokerAddress from)
                 throws BrokerException {
        logger.log(logger.INFO,"Rolling back recovery remote transaction " + tid + " from "+from);

        TransactionList translist = Globals.getTransactionList();
        TransactionState ts = translist.getRemoteTransactionState(tid);
        if (ts == null || ts.getState() != TransactionState.ROLLEDBACK) {
            throw new BrokerException(Globals.getBrokerResources().E_INTERNAL_BROKER_ERROR,
            "Unexpected broker state "+ts+ " for processing Rolledback remote transaction "+tid);
        }
        TransactionBroker ba = translist.getRemoteTransactionHomeBroker(tid);
        BrokerAddress currba = (ba == null) ? null: ba.getCurrentBrokerAddress();
View Full Code Here

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

    ByteArrayInputStream bais2 = new ByteArrayInputStream(objectBody);
    ObjectInputStream ois = new ObjectInputStream(bais2);

    try {

      TransactionState ts = (TransactionState) ois.readObject();
     
      localTransaction.setTransactionState(ts);

    } catch (ClassNotFoundException e) {
      e.printStackTrace();
View Full Code Here

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

            // Make a shallow copy first
            TransactionInfo newTxnInfo = (TransactionInfo)super.clone();

            // Now do deep copy of mutable objects
            if (state != null) {
                newTxnInfo.state = new TransactionState(state);
            }

            if (txnBkrs != null) {
                newTxnInfo.txnBkrs = (TransactionBroker[])txnBkrs.clone();
            }
View Full Code Here

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

    }

    public TransactionInfo(TransactionInfo tif) {

        type = tif.getType();
        state = new TransactionState(tif.getTransactionState());
        txnHomeBroker = tif.getTransactionHomeBroker();
        setTransactionBrokers(tif.getTransactionBrokers());
    }
View Full Code Here

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

      while (rs.next()) {
    long id = rs.getLong(1);
    tid = new TransactionUID(id);
    int state = rs.getInt(2);
   
    TransactionState txnState = (TransactionState)Util.readObject(rs, 3);
    if(DEBUG)
    {
      String msg = "reading transaction from old format: state="+state+
      " txnState = "+txnState;
      logger.log(Logger.DEBUG, msg);
    }
    txnState.setState(state);

    // insert in new table
    try {
                    pstmt.setLong( 1, id );
                    pstmt.setInt( 2, TransactionInfo.TXN_LOCAL );
                    pstmt.setInt( 3, state );
                    pstmt.setInt( 4, txnState.getType().intValue() );

                    JMQXid jmqXid = txnState.getXid();
                    if ( jmqXid != null ) {
                        pstmt.setString( 5, jmqXid.toString() );
                    } else {
                        pstmt.setNull( 5, Types.VARCHAR );
                    }

                    Util.setObject( pstmt, 6, txnState );
                    Util.setObject( pstmt, 7, null );
                    Util.setObject( pstmt, 8, null );                   

                    pstmt.setLong( 9, storeSessionID );
                    pstmt.setLong( 10, txnState.getExpirationTime() );
                    pstmt.setLong( 11, txnState.getLastAccessTime() );

        if (dobatch) {
      pstmt.addBatch();
        } else {
      pstmt.executeUpdate();
View Full Code Here

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

        logger.log(Logger.DEBUG, getPrefix() + " convert txn "+baseTxn);
      }

      TransactionUID id = baseTxn.getTid();

      TransactionState ts = baseTxn.getTransactionState();

      int finalState = ts.getState();

      ts.setState(TransactionState.STARTED);

      // TransactionState
      fileStore.storeTransaction(id, ts, true);

      TransactionWork txnWork = baseTxn.getTransactionWork();
      if (txnWork != null)
        convertWork(txnWork, ts, id);

      ts.setState(TransactionState.PREPARED);
      fileStore.updateTransactionState(id, ts, true);

    }
View Full Code Here

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

        IOException {

      ClusterTransaction clusterTxn = (ClusterTransaction) baseTxn;
      TransactionUID id = baseTxn.getTid();

      TransactionState ts = baseTxn.getTransactionState();

      int finalState = ts.getState();

      ts.setState(TransactionState.STARTED);

      // TransactionState
      fileStore.storeTransaction(id, ts, true);

      TransactionWork txnWork = baseTxn.getTransactionWork();
      if (txnWork != null)
        convertWork(txnWork, ts, id);

      store.updateClusterTransaction(id, clusterTxn
          .getTransactionBrokers(), Destination.PERSIST_SYNC);

      ts.setState(TransactionState.PREPARED);
      fileStore.updateTransactionState(id, ts, true);

    }
View Full Code Here

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

        IOException {

      RemoteTransaction remoteTxn = (RemoteTransaction) baseTxn;
      TransactionUID id = baseTxn.getTid();

      TransactionState ts = baseTxn.getTransactionState();

      store.storeRemoteTransaction(id, ts, remoteTxn.getTxnAcks(),
          remoteTxn.getTxnHomeBroker(), Destination.PERSIST_SYNC);
    }
View Full Code Here

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

    List<BaseTransaction> txns = getAllIncompleteTransactions();
    HashMap map = new HashMap(txns.size());
    Iterator<BaseTransaction> itr = txns.iterator();
    while (itr.hasNext()) {
      BaseTransaction txn = itr.next();
      TransactionState txnState = new TransactionState(txn
          .getTransactionState());
      map.put(txn.getTid(), txnState);
    }
    return map;
  }
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.