Package javax.transaction.xa

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


                if (e.errorCode != XAException.XAER_NOTA)
                    throw e;
            }

            try {
                xar.end(xid11, XAResource.TMSUCCESS);
            } 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.end(xid11, XAResource.TMFAIL);
            } catch (XAException e) {
                if (e.errorCode != XAException.XAER_NOTA)
                    throw e;
            }
View Full Code Here

                if (e.errorCode != XAException.XAER_NOTA)
                    throw e;
            }

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

            ResultSet rs = s
                    .executeQuery("select * from APP.foo where A >= 2000");
            JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
            rs.close();

            xar.end(xid, XAResource.TMSUCCESS);
            xar.prepare(xid);

            /*
             -- dup id
             xa_start xa_noflags 1;
View Full Code Here

                        .println("FAIL: setAutoCommit(true) allowed in global xact");
            } catch (SQLException e) {
            }
            conn.setAutoCommit(false);

            xar.end(xid2, XAResource.TMSUSPEND);

            /*
             -- get local connection again
             xa_getconnection;

View Full Code Here

             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");
            JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
View Full Code Here

            s.executeUpdate("delete from APP.foo");
            rs = s.executeQuery("select * from APP.foo where A >= 2000");
            JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
            rs.close();
            try {
                xar.end(xid3, XAResource.TMFAIL);
            } catch (XAException e) {
                if (e.errorCode != XAException.XA_RBROLLBACK)
                    throw e;
            }
            xar.rollback(xid3);
View Full Code Here

            showHoldStatus("Global xact Statement pshh_d ", pshh_d);
            showHoldStatus("Global xact Statement psch_d ", psch_d);
            }
       
            xar.end(xid, XAResource.TMSUCCESS);
            if (xar.prepare(xid) != XAResource.XA_RDONLY)
                System.out.println("FAIL prepare didn't indicate r/o");
           
            // All the ResultSets should be closed. Run a simple
            // test, clearWarnings throws an error if the ResultSet
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

      //start a global transaction and default holdability and autocommit will be switched to match Derby XA restrictions
      xr.start(xid, XAResource.TMNOFLAGS);
      System.out.println("Notice that autocommit now is " + conn1.getAutoCommit() + " for connection because it is part of the global transaction");
      System.out.println("Notice that connection's holdability at this point is CLOSE_CURSORS_AT_COMMIT because it is part of the global transaction");
      System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
      xr.end(xid, XAResource.TMSUCCESS);
      conn1.commit();
      conn1.close();

      xid = getXid(27, (byte) 21, (byte) 01);
      xr.start(xid, XAResource.TMNOFLAGS);
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.