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

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


    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

            // 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

    }

    public TransactionInfo(TransactionInfo tif) {

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

      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

        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

        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

        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

    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

    long id = rs.getLong(1);
    tid = new TransactionUID(id);
                int type = rs.getInt(2);
                int state = rs.getInt(3);

                TransactionState txnState = (TransactionState)Util.readObject(rs, 4);
                txnState.setState(state);

                BrokerAddress txnHomeBroker = (BrokerAddress)Util.readObject(rs, 5);
                TransactionBroker[] txnBrokers = (TransactionBroker[])Util.readObject(rs, 6);

                long sessionID = rs.getLong(7);

    // insert in new table
    try {
                    pstmt.setLong( 1, id );
                    pstmt.setInt( 2, type );
                    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, txnHomeBroker );
                    Util.setObject( pstmt, 8, txnBrokers );

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

        if (dobatch) {
      pstmt.addBatch();
        } else {
      pstmt.executeUpdate();
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.