Package javax.transaction.xa

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


    xaRes.start(xidMock, XAResource.TMNOFLAGS);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaRes.prepare(xidMock);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaResControl.setReturnValue(0);
    xaRes.commit(xidMock, false);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaRes.end(xidMock, XAResource.TMSUCCESS);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);

    sfControl.replay();
View Full Code Here


            s.close();
            xar.end(xid, XAResource.TMSUCCESS);

            // 1 phase commit
            xar.commit(xid, true);

            conn.close();
            xac.close();

        } catch (SQLException sqle) {
View Full Code Here

            for (int i = 0; i < recoveredStart.length; i++) {
                Xid xid = recoveredStart[i];
                if (xid.getFormatId() == 1) {
                    // commit 1 with 2pc
                    xar.commit(xid, false);
                } else if (xid.getFormatId() == 2) {
                    xar.rollback(xid);
                } else {
                    System.out.println("FAIL: unknown xact");
                }
View Full Code Here

            if (pr != XAResource.XA_RDONLY)
                System.out.println("FAIL - prepare on read only xact returned "
                        + pr);

            try {
                xar.commit(xid3, true);
                System.out.println("FAIL - 2pc commit on read-only xact");
            } catch (XAException e) {
                if (e.errorCode != XAException.XAER_NOTA)
                    throw e;
            }
View Full Code Here

            } catch (XAException e) {
                if (e.errorCode != XAException.XAER_NOTA)
                    throw e;
            }
            try {
                xar.commit(xid11, false);
            } catch (XAException e) {
                if (e.errorCode != XAException.XAER_NOTA)
                    throw e;
            }
            try {
View Full Code Here

            } catch (XAException e) {
                if (e.errorCode != XAException.XAER_NOTA)
                    throw e;
            }
            try {
                xar.commit(xid11, true);
            } catch (XAException e) {
                if (e.errorCode != XAException.XAER_NOTA)
                    throw e;
            }
            try {
View Full Code Here

             -- local transaction.
             xa_commit xa_2phase 1;
             xa_end xa_success 2;
             xa_rollback 2;
             */
            xar.commit(xid, false);
            xar.end(xid2, XAResource.TMSUCCESS);
            xar.rollback(xid2);

            XATestUtil.showXATransactionView(conn);
            rs = s.executeQuery("select * from APP.foo where A >= 2000");
View Full Code Here

        }

        public void commit(TransactionResource resource) throws DavException {
            XAResource xaRes = getXAResource(resource);
            try {
                xaRes.commit(xid, false);
                removeLocalTxReferences(resource);
            } catch (XAException e) {
                throw new DavException(DavServletResponse.SC_FORBIDDEN, e.getMessage());
            }
        }
View Full Code Here

      }
      xr.end(xid, XAResource.TMSUCCESS);


      if (xr.prepare(xid) != XAResource.XA_RDONLY)
        xr.commit(xid, false);

      // try again once the xa transaction has been committed.     
      try {
        rsx.next(); System.out.println("FAIL - rsx's connection not active id (B)" + rsx.getInt(1));
      } catch (SQLException sqle) {
View Full Code Here

   {
      log.debug("Commit " + providerName + " xid " + " onePhase=" + onePhase);
      XAResource xaResource = getDelegate();
      try
      {
         xaResource.commit(xid, onePhase);
      }
      catch (XAException e)
      {
         throw check(e);
      }
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.