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

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


     * @throws BrokerException
     */
    public TransactionState getTransactionState( Connection conn,
        TransactionUID txnUID ) throws BrokerException {

        TransactionState txnState = null;
        long id = txnUID.longValue();

        boolean myConn = false;
        PreparedStatement pstmt = null;
        ResultSet rs = null;
        Exception myex = null;
        try {
            // Get a connection
            if ( conn == null ) {
                conn = DBManager.getDBManager().getConnection( true );
                myConn = true;
            }

            pstmt = conn.prepareStatement( selectTxnStateSQL );
            pstmt.setLong( 1, id );
            rs = pstmt.executeQuery();
            if ( rs.next() ) {
                try {
                    int state = rs.getInt( 1 );
                    txnState = (TransactionState)Util.readObject( rs, 2 );

                    // update state in TransactionState object
                    txnState.setState( state );
                } catch ( IOException e ) {
                    // fail to parse TransactionState object; just log it
                    logger.logStack( Logger.ERROR,
                        BrokerResources.X_PARSE_TRANSACTION_FAILED, e );
                }
View Full Code Here


            rs = pstmt.executeQuery();
            if ( rs.next() ) {
                int type = rs.getInt( 1 );
                int state = rs.getInt( 2 );

                TransactionState txnState =
                    (TransactionState)Util.readObject( rs, 3 );

                // update state in TransactionState object
                txnState.setState( state );

                BrokerAddress txnHomeBroker =
                    (BrokerAddress)Util.readObject( rs, 4 );
                TransactionBroker[] txnBrokers =
                    (TransactionBroker[])Util.readObject( rs, 5 );
View Full Code Here

                try {
                    long id = rs.getLong( 1 );
                    int type = rs.getInt( 2 );
                    int state = rs.getInt( 3 );

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

                    TransactionBroker[] txnBrokers =
                        (TransactionBroker[])Util.readObject( rs, 5 );
                   
                    map.put( new TransactionUID( id ),
View Full Code Here

            while ( rs.next() ) {
                try {
                    long id = rs.getLong( 1 );
                    int state = rs.getInt( 2 );
                    TransactionState txnState =
                        (TransactionState)Util.readObject( rs, 3 );

                    // update state in TransactionState object
                    txnState.setState( state );

                    map.put( new TransactionUID( id ), txnState );
                } catch ( IOException e ) {
                    // fail to parse TransactionState object; just log it
                    logger.logStack( Logger.ERROR,
View Full Code Here

  return (cd);
    }

    public static String getClientID(TransactionUID tid)  {
  TransactionList tl = Globals.getTransactionList();
  TransactionState ts;

  if (tl == null)  {
      return (null);
  }

  ts = tl.retrieveState(tid);

  if (ts == null)  {
      return (null);
  }

  return (ts.getClientID());
    }
View Full Code Here

  return (ts.getClientID());
    }

    public static String getConnectionString(TransactionUID tid)  {
  TransactionList tl = Globals.getTransactionList();
  TransactionState ts;

  if (tl == null)  {
      return (null);
  }

  ts = tl.retrieveState(tid);

  if (ts == null)  {
      return (null);
  }

  return (ts.getConnectionString());
    }
View Full Code Here

  return (new Long(tl.retrieveNSentMessages(tid)));
    }

    public static Integer getState(TransactionUID tid)  {
  TransactionList tl = Globals.getTransactionList();
  TransactionState ts;

  if (tl == null)  {
      return (null);
  }

  ts = tl.retrieveState(tid);

  if (ts == null)  {
      return (null);
  }

  return (new Integer(toExternalTransactionState(ts.getState())));
    }
View Full Code Here

        i.intValue()));
    }

    public static String getUser(TransactionUID tid)  {
  TransactionList tl = Globals.getTransactionList();
  TransactionState ts;

  if (tl == null)  {
      return (null);
  }

  ts = tl.retrieveState(tid);

  if (ts == null)  {
      return (null);
  }

  return (ts.getUser());
    }
View Full Code Here

          throw new Exception("Invalid transaction ID: " + transactionID);
      }

      TransactionUID tid = new TransactionUID(longTid);
      TransactionList tl = Globals.getTransactionList();
      TransactionState ts;

      if (tl == null)  {
          throw new Exception("Null transaction list");
      }

      ts = tl.retrieveState(tid);

      if (ts == null)  {
          throw new Exception(rb.getString(rb.E_NO_SUCH_TRANSACTION, tid));
      }

      if (ts.getState() != TransactionState.PREPARED)  {
          throw new Exception(rb.getString(rb.E_TRANSACTION_NOT_PREPARED, tid));
      }

      JMQXid xid = tl.UIDToXid(tid);
View Full Code Here

                    BrokerResources.E_TRAN_ACK_PROCESSING_FAILED, emsg, ex.getMessage()), ex);
                }
                int state = -1;
                JMQXid xid = null;
                try {
                    TransactionState ts = translist.retrieveState(tid);
                    if (ts != null) {
                        state = ts.getState();
                        xid = ts.getXid();
                    }
                    translist.updateState(tid, TransactionState.FAILED, true);
                } catch (Exception e) {
                    if (!(e instanceof UnknownTransactionException)) {
                    String args[] = { TransactionState.toString(state),
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.