Package javax.jms

Examples of javax.jms.Session.rollback()


            Connection conn = getConnection("test", "client", "guest");
            Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
            conn.start();

            //Do something to show connection is active.
            sess.rollback();

            conn.close();
        }
        catch (Exception e)
        {
View Full Code Here


        try
        {
            Connection conn = getConnection("test", "guest", "guest");
            Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
            conn.start();
            sess.rollback();

            fail("Connection was created.");
        }
        catch (JMSException e)
        {
View Full Code Here

        subscriber.close();
        sess.unsubscribe("kipper");

        //Do something to show connection is active.
        sess.rollback();
        conn.close();
    }


    public void setUpClientDeleteQueueFailure() throws Exception
View Full Code Here

        try
        {
            sess.unsubscribe("kipper");

            //Do something to show connection is active.
            sess.rollback();

            fail("Exception was not thrown");
        }
        catch (JMSException e)
        {
View Full Code Here

        subscriber.close();
        sess.unsubscribe("kipper");

        //Do something to show connection is active.
        sess.rollback();
        conn.close();
    }
}
View Full Code Here

            final Session session = _testSessions.get(sessionName);
            synchronized(session)
            {
                if (session.getTransacted())
                {
                    session.rollback();
                }
                else if (session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE)
                {
                    session.recover();
                }
View Full Code Here

            final Session session = _testSessions.get(sessionName);
            synchronized(session)
            {
                if (session.getTransacted())
                {
                    session.rollback();
                }
                else
                {
                    session.recover();
                }
View Full Code Here

            }
           
            synchronized (syncObj) {

                Session session = client.getSession();
                session.rollback();
            }
              
            if (UMSServiceImpl.debug) {
                logger.info ("*** Transaction rolled back. sid=" + client.getId());
            }
View Full Code Here

        Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
        MessageConsumer consumer = session.createConsumer(new ActiveMQQueue(getDestinationString()));
        Message message = consumer.receive(5000);
        while (message != null) {
            echo("Message: " + message.getJMSMessageID() + " redelivered " + message.getJMSRedelivered() + " counter " + message.getObjectProperty("JMSXDeliveryCount"));
            session.rollback();
            message = consumer.receive(2000);
        }
        consumer.close();
        session.close();
View Full Code Here

       //Now rollback

       long now = System.currentTimeMillis();
              
       sess2.rollback();
      
       //This should redeliver with a delayed redelivery
 
       for (int i = 0; i < NUM_MESSAGES; i++)
       {
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.