Package com.atomikos.datasource.xa

Examples of com.atomikos.datasource.xa.DefaultXidFactory


        broker.start();

        String url = "tcp://localhost:61616";
        String qName = "MyQueue";
        int timeout = 5;
        DefaultXidFactory xidFactory = new DefaultXidFactory();
        ActiveMQXAConnectionFactory xacf = new ActiveMQXAConnectionFactory();
        xacf.setBrokerURL(url);
        ActiveMQQueue queue = new ActiveMQQueue();
        queue.setPhysicalName(qName);
        XAConnection xaconn = xacf.createXAConnection();
        xaconn.start();
        XASession session = xaconn.createXASession();
        XAResource xares = session.getXAResource();
        MessageConsumer receiver = session.getSession().createConsumer(queue);
        xares.recover(XAResource.TMSTARTRSCAN);
        xares.recover(XAResource.TMNOFLAGS);
        xares.setTransactionTimeout(timeout);
        xares.isSameRM(xares);
        Xid xid = xidFactory.createXid("part1", "part2");
        xares.start(xid, XAResource.TMNOFLAGS);
        receiver.receive(timeout);
        xares.end(xid, XAResource.TMSUCCESS);
        xares.rollback(xid);
View Full Code Here


   
 
        String url = "tcp://localhost:61616";
        String qName = "MyQueue";
        int timeout = 5;
        DefaultXidFactory xidFactory = new DefaultXidFactory();
        ActiveMQXAConnectionFactory xacf = new ActiveMQXAConnectionFactory();
        xacf.setBrokerURL(url);
        ActiveMQQueue queue = new ActiveMQQueue();
        queue.setPhysicalName(qName);
        XAConnection xaconn = xacf.createXAConnection();
        xaconn.start();
        XASession session = xaconn.createXASession();
        XAResource xares = session.getXAResource();
        MessageConsumer receiver = session.getSession().createConsumer(queue);
        xares.recover(XAResource.TMSTARTRSCAN);
        xares.recover(XAResource.TMNOFLAGS);
        xares.setTransactionTimeout(timeout);
        xares.isSameRM(xares);
        Xid xid = xidFactory.createXid("part1", "part2");
        xares.start(xid, XAResource.TMNOFLAGS);
        receiver.receive(timeout);
        xares.end(xid, XAResource.TMSUCCESS);
        xares.rollback(xid);
View Full Code Here

            // ONLY attempt getOrCreate if getInstance fails; to avoid
            // overhead of synchronization of getOrCreate

            XidFactory xidFactory = null;

            xidFactory = new DefaultXidFactory ();

            // try {
            // Context ctx = new InitialContext();
            // xaFactory_ = ( XAQueueConnectionFactory ) ctx.lookup (
            // xaLookupName_ );
View Full Code Here

              // ONLY attempt getOrCreate if getInstance fails; to avoid
              // overhead of synchronization of getOrCreate

              XidFactory xidFactory = null;

              xidFactory = new DefaultXidFactory ();

              if ( xaFactory_ == null && "".equals ( xaFactoryJndiName_ ) )
                  throw new JMSException (
                          "TopicConnectionFactoryBean: XATopicConnectionFactory not set?" );
              if ( !"".equals ( xaFactoryJndiName_ ) ) {
View Full Code Here

            // ONLY attempt getOrCreate if getInstance fails; to avoid
            // overhead of synchronization of getOrCreate

            XidFactory xidFactory = null;

            xidFactory = new DefaultXidFactory ();

            // try {
            // Context ctx = new InitialContext();
            // xaFactory_ = ( XAQueueConnectionFactory ) ctx.lookup (
            // xaLookupName_ );
View Full Code Here

              // ONLY attempt getOrCreate if getInstance fails; to avoid
              // overhead of synchronization of getOrCreate

              XidFactory xidFactory = null;

              xidFactory = new DefaultXidFactory ();

              if ( xaFactory_ == null && "".equals ( xaFactoryJndiName_ ) )
                  throw new JMSException (
                          "TopicConnectionFactoryBean: XATopicConnectionFactory not set?" );
              if ( !"".equals ( xaFactoryJndiName_ ) ) {
View Full Code Here

                      + e.getMessage () + " " + e.getClass ().getName () );
          }
        }
        XidFactory xidFactory = null;

        xidFactory = new DefaultXidFactory ();

        XAConnectionFactory factory = new XAConnectionFactory ( resourceName_,
                "", "", xads_, xidFactory );
        factory.setExclusive ( exclusive_ );
View Full Code Here

            }
        }

        XidFactory xidFactory = null;

        xidFactory = new DefaultXidFactory ();

        XAConnectionFactory factory = new XAConnectionFactory ( resourceName_,
                "", "", xads_, xidFactory );
        factory.setExclusive ( exclusive_ );
        ds_ = new JtaDataSourceImp ( factory, poolSize_, connectionTimeout_,
View Full Code Here

            }
        }

        XidFactory xidFactory = null;

        xidFactory = new DefaultXidFactory ();

        XAConnectionFactory factory = new XAConnectionFactory ( resourceName_,
                "", "", xads_, xidFactory );
        factory.setExclusive ( exclusive_ );
        ds_ = new JtaDataSourceImp ( factory, poolSize_, connectionTimeout_,
View Full Code Here

                      + e.getMessage () + " " + e.getClass ().getName () );
          }
        }
        XidFactory xidFactory = null;

        xidFactory = new DefaultXidFactory ();

        XAConnectionFactory factory = new XAConnectionFactory ( resourceName_,
                "", "", xads_, xidFactory );
        factory.setExclusive ( exclusive_ );
View Full Code Here

TOP

Related Classes of com.atomikos.datasource.xa.DefaultXidFactory

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.