Examples of Xid


Examples of javax.transaction.xa.Xid

         XAResource res1 = sess1.getXAResource();
  
         XAResource res2 = sess2.getXAResource();
  
         //Pretend to be a transaction manager by interacting through the XAResources
         Xid xid1 = new XidImple(new Uid("cadaver"), new Uid("bq1"), 666);
         Xid xid2 = new XidImple(new Uid("dalidom"), new Uid("bq2"), 661);   // TODO
  
  
         //    Send a message in each tx
  
         res1.start(xid1, XAResource.TMNOFLAGS);
View Full Code Here

Examples of javax.transaction.xa.Xid

         XAResource res1 = sess1.getXAResource();
  
         XAResource res2 = sess2.getXAResource();
  
         //Pretend to be a transaction manager by interacting through the XAResources
         Xid xid1 = new MessagingXid("bq1".getBytes(), 123, "gbtxid1".getBytes());
         Xid xid2 = new MessagingXid("bq2".getBytes(), 124, "gbtxid2".getBytes());
  
         //    Send a message in each tx
  
         res1.start(xid1, XAResource.TMNOFLAGS);
  
View Full Code Here

Examples of javax.transaction.xa.Xid

         XAResource res1 = sess1.getXAResource();
  
         XAResource res2 = sess2.getXAResource();
  
         //Pretend to be a transaction manager by interacting through the XAResources
         Xid xid1 = new MessagingXid("bq1".getBytes(), 123, "gbtxid1".getBytes());
         Xid xid2 = new MessagingXid("bq2".getBytes(), 124, "gbtxid2".getBytes());
  
         //    Send a message in each tx
  
         res1.start(xid1, XAResource.TMNOFLAGS);
  
View Full Code Here

Examples of javax.transaction.xa.Xid

      JBossStringBuilder buffer = new JBossStringBuilder();
      buffer.append("<table width=\"100%\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\">");
      buffer.append("<tr><th>Xid</th></tr>");
      for (Iterator i = txs.iterator(); i.hasNext();)
      {
         Xid xid = (Xid)i.next();
         if (xid != null)
         {
            buffer.append("<tr><td>");
            buffer.append(xid);
            buffer.append("</td></tr>");
View Full Code Here

Examples of javax.transaction.xa.Xid

            }
            workListener.workStarted(new WorkEvent(this, WorkEvent.WORK_STARTED, work, null));
        }

        // Setup ExecutionContext
        Xid xid = null;
        if (executionContext != null) {
            xid = executionContext.getXid();
            if (xid != null) {
                long txtimeout = executionContext.getTransactionTimeout();
                try {
View Full Code Here

Examples of javax.transaction.xa.Xid

           
            int formatId = rs.getInt(3);
           
            byte[] globalTxId = getVarBinaryColumn(rs, 4);
           
            Xid xid = new MessagingXid(branchQual, formatId, globalTxId);
           
            // create a tx info object with the result set detailsdetails
            txInfo = new PreparedTxInfo(txId, xid);
           
            transactions.add(txInfo);
View Full Code Here

Examples of javax.transaction.xa.Xid

        
         ps = conn.prepareStatement(statement);
        
         ps.setLong(1, tx.getId());
        
         Xid xid = tx.getXid();
        
         formatID = xid.getFormatId();
        
         setVarBinaryColumn(2, ps, xid.getBranchQualifier());
        
         ps.setInt(3, formatID);
        
         setVarBinaryColumn(4, ps, xid.getGlobalTransactionId());
        
         rows = updateWithRetry(ps);
        
      }
      finally
View Full Code Here

Examples of javax.transaction.xa.Xid

      return tx;
   }
  
   public void deleteTransaction(Transaction transaction) throws Exception
   {
     final Xid id = transaction.getXid();
     final int state = transaction.getState();
    
     if (id == null)
     {
       throw new IllegalArgumentException("DeleteTransaction was called for non XA transaction");
View Full Code Here

Examples of javax.transaction.xa.Xid

   {
      if (!(other instanceof Xid))
      {
         return false;
      }
      Xid xother = (Xid)other;
      if (xother.getFormatId() != formatId)
      {
         return false;
      }
      if (xother.getBranchQualifier().length != this.branchQualifier.length)
      {
         return false;
      }
      if (xother.getGlobalTransactionId().length != this.globalTransactionId.length)
      {
         return false;
      }
      for (int i = 0; i < this.branchQualifier.length; i++)
      {
         byte[] otherBQ = xother.getBranchQualifier();
         if (this.branchQualifier[i] != otherBQ[i])
         {
            return false;
         }        
      }
      for (int i = 0; i < this.globalTransactionId.length; i++)
      {
         byte[] otherGtx = xother.getGlobalTransactionId();
         if (this.globalTransactionId[i] != otherGtx[i])
         {
            return false;
         }
      }
View Full Code Here

Examples of javax.transaction.xa.Xid

     
      try
      {
         conn = cf.createXAConnection();
        
         Xid xid1, xid2;
        
         {
        
            XASession sess = conn.createXASession();
           
            XAResource res = sess.getXAResource();
           
            MessageProducer prod = sess.createProducer(queue);
           
            xid1 = new MessagingXid("blah1".getBytes(), 42, "blahblah1".getBytes());
                    
            TextMessage tm = sess.createTextMessage("message1");
           
            res.start(xid1, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid1, XAResource.TMSUCCESS);
           
            res.prepare(xid1);
        
         }
        
         {
           
            XASession sess = conn.createXASession();
           
            XAResource res = sess.getXAResource();
           
            MessageProducer prod = sess.createProducer(queue);
           
            xid2 = new MessagingXid("blah2".getBytes(), 42, "blahblah2".getBytes());
                    
            TextMessage tm = sess.createTextMessage("message1");
           
            res.start(xid2, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid2, XAResource.TMSUCCESS);
           
            res.prepare(xid2);
        
         }
        
         List txList = (List)ServerManagement.invoke(ServerManagement.getServerPeerObjectName(),
                  "retrievePreparedTransactions", null, null);
        
         assertNotNull(txList);
        
         assertEquals(2, txList.size());
        
         Xid rxid1 = (Xid)txList.get(0);
        
         Xid rxid2 = (Xid)txList.get(1);
        
        
         boolean ok = (xid1.equals(rxid1) && xid2.equals(rxid2)) ||
                      (xid2.equals(rxid1) && xid1.equals(rxid2));
        
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.