Package javax.jms

Examples of javax.jms.XAConnection.createXASession()


         conn.start();

         tm.begin();

         // Create 2 sessions and enlist them
         XASession sess1 = conn.createXASession();
         XAResource res1 = sess1.getXAResource();
         XASession sess2 = conn.createXASession();
         XAResource res2 = sess2.getXAResource();

         Transaction tx = tm.getTransaction();
View Full Code Here


         tm.begin();

         // Create 2 sessions and enlist them
         XASession sess1 = conn.createXASession();
         XAResource res1 = sess1.getXAResource();
         XASession sess2 = conn.createXASession();
         XAResource res2 = sess2.getXAResource();

         Transaction tx = tm.getTransaction();
         tx.enlistResource(res1);
         tx.enlistResource(res2);
View Full Code Here

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();

         // Create a session
         JBossSession sess1 = (JBossSession)conn.createXASession();
         DummyListener listener = new DummyListener();
         sess1.setMessageListener(listener);
         conn.start();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         tm.begin();
View Full Code Here

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();

         // Create a session
         XASession sess1 = conn.createXASession();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
         byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
         int rmSizeBeforeStart = rm.size();
         Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
View Full Code Here

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();

         // Create a session
         XASession sess1 = conn.createXASession();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
         byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
         int rmSizeBeforeStart = rm.size();
         Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
View Full Code Here

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();

         // Create a session
         XASession sess1 = conn.createXASession();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
         byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
         int rmSizeBeforeStart = rm.size();
         Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
View Full Code Here

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();

         // Create a session
         XASession sess1 = conn.createXASession();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
         byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
         int rmSizeBeforeStart = rm.size();
         Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
View Full Code Here

         XAConnectionFactory xcf = (XAConnectionFactory)cf;

         XAConnection xconn = xcf.createXAConnection();

         XASession xs = xconn.createXASession();

         MessageProducer p = xs.createProducer(queue1);
         Message m = xs.createTextMessage("one");

         p.send(m);
View Full Code Here

         // using XA with a ConnectionConsumer (testing the transaction behavior under MDBs)

         XAConnectionFactory xacf = (XAConnectionFactory)cf;
         xaconn = xacf.createXAConnection();
         xaconn.start();
         XASession xasession = xaconn.createXASession();
         DummyListener listener = new DummyListener();
         xasession.setMessageListener(listener);

         ServerSessionPool pool = new MockServerSessionPool(xasession);
View Full Code Here

         XAConnection xconn = xcf.createXAConnection();
         xconn.start();

         // no active JTA transaction here

         XASession xs = xconn.createXASession();

         MessageConsumer c = xs.createConsumer(queue1);

         // the message should be store unacked in the local session
         TextMessage rm = (TextMessage)c.receive(1000);
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.