Package javax.transaction.xa

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


            } catch (Exception e) {
                LOG.debug("Caught exception:", e);

                try {
                    LOG.debug("Rolling back transaction (just in case, no need to do this as it is implicit in a 1pc commit failure) " + tid);
                    resource.rollback(tid);
                }
                catch (XAException ex) {
                    try {
                        LOG.debug("Caught exception during rollback: " + ex + " forgetting transaction " + tid);
                        resource.forget(tid);
View Full Code Here


        // 2nd global (existing)
        assertConnectionState(ResultSet.CLOSE_CURSORS_AT_COMMIT,
            Connection.TRANSACTION_REPEATABLE_READ,
            false, false, conn);
        xar.end(xid2, XAResource.TMSUCCESS);
        xar.rollback(xid2);
        // (After 2nd global rollback ) local
        assertConnectionState(ResultSet.HOLD_CURSORS_OVER_COMMIT,
            Connection.TRANSACTION_READ_UNCOMMITTED,
            true, false, conn);
View Full Code Here

        // (After 2nd global rollback ) local
        assertConnectionState(ResultSet.HOLD_CURSORS_OVER_COMMIT,
            Connection.TRANSACTION_READ_UNCOMMITTED,
            true, false, conn);

        xar.rollback(xid);
        // (After 1st global rollback) local
        assertConnectionState(ResultSet.HOLD_CURSORS_OVER_COMMIT,
            Connection.TRANSACTION_READ_UNCOMMITTED,
            true, false, conn);
        //Confirm - no connection closed event & connection error event
View Full Code Here

     
      xaRes1.prepare(xid1);
      xaRes2.prepare(xid2);
     
      xaRes1.rollback(xid1);
      xaRes2.rollback(xid2);
     
      this.rs = this.stmt.executeQuery("SELECT field1 FROM testCoordination ORDER BY field1");
     
      assertTrue(!this.rs.next());
    } finally {
View Full Code Here

            status = Status.STATUS_ROLLING_BACK;
            for (Iterator it = xaResources.keySet().iterator(); it.hasNext(); ) {
                XAResource resource = (XAResource) it.next();
                XidImpl xid = (XidImpl) xaResources.get(resource);
                resource.rollback(xid);
            }
            status = Status.STATUS_ROLLEDBACK;

        } catch (XAException e) {
            SystemException se = new SystemException(
View Full Code Here

                    rs.close();
                if (stm != null)
                    stm.close();

                // rollback the global transaction
                xaRes.rollback(xid);
                // close the connection
                xaConn.close();
            } catch (Exception e) {
                // ignore the exception because it
                // would hide the original exception
View Full Code Here

        // close all the stuff
        rs.close();
        stm.close();

        // rollback the global transaction
        xaRes.rollback(xid);

        // close the connection
        xaConn.close();
    }
View Full Code Here

            status = Status.STATUS_ROLLING_BACK;
            for (Iterator it = xaResources.keySet().iterator(); it.hasNext(); ) {
                XAResource resource = (XAResource) it.next();
                XidImpl xid = (XidImpl) xaResources.get(resource);
                resource.rollback(xid);
            }
            status = Status.STATUS_ROLLEDBACK;

        } catch (XAException e) {
            SystemException se = new SystemException(
View Full Code Here

        }

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

                //
                Xid xid = (i == UNIQUE_PK) ?
                        doXAWorkUniquePK(s, xar) :
                        doXAWorkCheck(s, xar);

                xar.rollback(xid);
                assertXidRolledBack(xar, xid);

                //
                // Do an XA prepare when we have a violation; expect exception
                // and rollback.
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.