Package javax.transaction.xa

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


      xr.end(xid, XAResource.TMSUCCESS);
      conn1.commit();
      conn1.close();

      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();
View Full Code Here


      rsh.next(); System.out.println("H@3 id " + rsh.getInt(1));
      conn.commit();


      xid = getXid(23, (byte) 21, (byte) 01);
      xr.start(xid, XAResource.TMNOFLAGS);
      Statement stmtInsideGlobalTransaction = conn.createStatement();
      PreparedStatement prepstmtInsideGlobalTransaction = conn.prepareStatement("select id from hold_30");
      CallableStatement callablestmtInsideGlobalTransaction = conn.prepareCall("select id from hold_30");

      System.out.println("CONNECTION(xa) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
View Full Code Here

      } catch (SQLException sqle) {
        System.out.println("Expected SQLException " + sqle.getMessage());
      }

      System.out.println("resume XA transaction and keep using rs");
      xr.start(xid, XAResource.TMJOIN);
      Statement stmtAfterGlobalTransactionResume = conn.createStatement();
      PreparedStatement prepstmtAfterGlobalTransactionResume = conn.prepareStatement("select id from hold_30");
      CallableStatement callablestmtAfterGlobalTransactionResume = conn.prepareCall("select id from hold_30");

      System.out.println("Check holdability of various jdbc objects after resuming XA transaction");
View Full Code Here

      System.out.println("Set connection to hold ");
      conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
      System.out.println("CONNECTION(held) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));

      xid = getXid(24, (byte) 21, (byte) 01);
      xr.start(xid, XAResource.TMNOFLAGS);
      System.out.println("CONNECTION(xa) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
      try {
        conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
        System.out.println("FAIL allowed to set hold mode in xa transaction");
      } catch (SQLException sqle) {
View Full Code Here

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

           
            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);
           
View Full Code Here

           
            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);
           
View Full Code Here

           
            xid1 = new MessagingXid("list-blah1".getBytes(), 43, "list-blahblah1".getBytes());
                    
            TextMessage tm = sess.createTextMessage("message-list");
           
            res.start(xid1, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid1, XAResource.TMSUCCESS);
           
View Full Code Here

           
            xid2 = new MessagingXid("list-blah2".getBytes(), 43, "list-blahblah2".getBytes());
                    
            TextMessage tm = sess.createTextMessage("message1-list");
           
            res.start(xid2, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid2, XAResource.TMSUCCESS);
           
View Full Code Here

           
            xid1 = new MessagingXid("list-blah1".getBytes(), 43, "list-blahblah1".getBytes());
                    
            TextMessage tm = sess.createTextMessage("message-list");
           
            res.start(xid1, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid1, XAResource.TMSUCCESS);
           
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.