Package javax.transaction.xa

Examples of javax.transaction.xa.XAResource.end()


      xid = getXid(27, (byte) 21, (byte) 01);
      xr.start(xid, XAResource.TMNOFLAGS);
      conn1 = xac.getConnection();
      System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
      System.out.println("Autocommit on Connection inside global transaction has been set correctly to " + conn1.getAutoCommit());
      xr.end(xid, XAResource.TMSUCCESS);
      conn1.rollback();

      Connection conn = xac.getConnection();
      conn.setAutoCommit(false);
      conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
View Full Code Here


      ResultSet rsx = s.executeQuery("select id from hold_30 for update");
      
      rsx.next(); System.out.println("X@1 id " + rsx.getInt(1));
      rsx.next(); System.out.println("X@2 id " + rsx.getInt(1));
      xr.end(xid, XAResource.TMSUCCESS);

      // result set should not be useable, since it is part of a detached
      // XAConnection
      try {
        rsx.next(); System.out.println("FAIL - rsx's connection not active id " + rsx.getInt(1));
View Full Code Here

      if (! stmtHoldabilityError)
      {
        // Network XA BUG gives result set closed
        rsx.next(); System.out.println("X@3 id " + rsx.getInt(1));
      }
      xr.end(xid, XAResource.TMSUCCESS);


      if (xr.prepare(xid) != XAResource.XA_RDONLY)
        xr.commit(xid, false);
View Full Code Here

           }     
             
      // but an update works
      sh.executeUpdate("insert into hold_30 values(10, 'init10')");

      xr.end(xid, XAResource.TMSUCCESS);
 
      System.out.println("CONNECTION(held) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));

      conn.close();
      System.out.println("PASS XA HOLDABILITY TEST");
View Full Code Here

                manager = (TransactionBranch) entry.getValue();
                flags = (status == Status.STATUS_MARKED_ROLLBACK) ? XAResource.TMFAIL : XAResource.TMSUCCESS;
                resourceMap.remove(xaRes);
            }
            try {
                xaRes.end(manager.getBranchId(), flags);
            } catch (XAException e) {
                log.warn("Error ending association for XAResource " + xaRes + "; transaction will roll back. XA error code: " + e.errorCode, e);
                synchronized (this) {
                    status = Status.STATUS_MARKED_ROLLBACK;
                }
View Full Code Here

   public void end(Xid xid, int flags) throws XAException
   {
      XAResource xaResource = getDelegate();
      try
      {
         xaResource.end(xid, flags);
      }
      catch (XAException e)
      {
         throw check(e);
      }
View Full Code Here

           
            res.start(xid1, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid1, XAResource.TMSUCCESS);
           
            res.prepare(xid1);
        
         }
        
View Full Code Here

           
            res.start(xid2, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid2, XAResource.TMSUCCESS);
           
            res.prepare(xid2);
        
         }
        
View Full Code Here

           
            res.start(xid1, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid1, XAResource.TMSUCCESS);
           
            res.prepare(xid1);
        
         }
        
View Full Code Here

           
            res.start(xid2, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid2, XAResource.TMSUCCESS);
           
            res.prepare(xid2);
        
         }
        
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.