Package com.sleepycat.je

Examples of com.sleepycat.je.XAEnvironment.end()


    fail("Expected XAER_DUPID");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_DUPID);
      }
      xaEnv.end(xid, XAResource.TMNOFLAGS);

      /*
       * Check that JOIN with a non-existant association throws NOTA.
       */
      try {
View Full Code Here


       * Check that start(JOIN) from a thread that is already associated
       * throws XAER_PROTO.
       */
      Xid xid2 = new XidImpl(1, "TwoPCTest3".getBytes(), null);
      xaEnv.start(xid2, XAResource.TMNOFLAGS);
      xaEnv.end(xid2, XAResource.TMNOFLAGS);
      xid = new XidImpl(1, "TwoPCTest2".getBytes(), null);
      xaEnv.start(xid, XAResource.TMNOFLAGS);
      try {
    xaEnv.start(xid2, XAResource.TMJOIN);
    fail("Expected XAER_PROTO");
View Full Code Here

      /*
       * Check that end(TMFAIL | TMSUCCESS) throws XAER_INVAL.
       */
      try {
    xid = new XidImpl(1, "TwoPCTest2".getBytes(), null);
    xaEnv.end(xid, XAResource.TMFAIL | XAResource.TMSUCCESS);
    fail("Expected XAER_INVAL");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_INVAL);
      }
View Full Code Here

      /*
       * Check that end(TMFAIL | TMSUSPEND) throws XAER_INVAL.
       */
      try {
    xid = new XidImpl(1, "TwoPCTest2".getBytes(), null);
    xaEnv.end(xid, XAResource.TMFAIL | XAResource.TMSUSPEND);
    fail("Expected XAER_INVAL");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_INVAL);
      }
View Full Code Here

      /*
       * Check that end(TMSUCCESS | TMSUSPEND) throws XAER_INVAL.
       */
      try {
    xid = new XidImpl(1, "TwoPCTest2".getBytes(), null);
    xaEnv.end(xid, XAResource.TMSUCCESS | XAResource.TMSUSPEND);
    fail("Expected XAER_INVAL");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_INVAL);
      }
View Full Code Here

       */
      Xid xid4 = new XidImpl(1, "TwoPCTest4".getBytes(), null);
      xaEnv.start(xid4, XAResource.TMNOFLAGS);
      Transaction txn4 = xaEnv.getThreadTransaction();
      assertTrue(txn4 != null);
      xaEnv.end(xid4, XAResource.TMSUSPEND);
      assertTrue(xaEnv.getThreadTransaction() == null);
      Xid xid5 = new XidImpl(1, "TwoPCTest5".getBytes(), null);
      xaEnv.start(xid5, XAResource.TMNOFLAGS);
      Transaction txn5 = xaEnv.getThreadTransaction();
      xaEnv.end(xid5, XAResource.TMSUSPEND);
View Full Code Here

      xaEnv.end(xid4, XAResource.TMSUSPEND);
      assertTrue(xaEnv.getThreadTransaction() == null);
      Xid xid5 = new XidImpl(1, "TwoPCTest5".getBytes(), null);
      xaEnv.start(xid5, XAResource.TMNOFLAGS);
      Transaction txn5 = xaEnv.getThreadTransaction();
      xaEnv.end(xid5, XAResource.TMSUSPEND);
      assertTrue(xaEnv.getThreadTransaction() == null);
      xaEnv.start(xid4, XAResource.TMRESUME);
      assertTrue(xaEnv.getThreadTransaction().equals(txn4));
      xaEnv.end(xid4, XAResource.TMNOFLAGS);
      xaEnv.start(xid5, XAResource.TMRESUME);
View Full Code Here

      Transaction txn5 = xaEnv.getThreadTransaction();
      xaEnv.end(xid5, XAResource.TMSUSPEND);
      assertTrue(xaEnv.getThreadTransaction() == null);
      xaEnv.start(xid4, XAResource.TMRESUME);
      assertTrue(xaEnv.getThreadTransaction().equals(txn4));
      xaEnv.end(xid4, XAResource.TMNOFLAGS);
      xaEnv.start(xid5, XAResource.TMRESUME);
      assertTrue(xaEnv.getThreadTransaction().equals(txn5));
      xaEnv.end(xid5, XAResource.TMNOFLAGS);

      /*
 
View Full Code Here

      xaEnv.start(xid4, XAResource.TMRESUME);
      assertTrue(xaEnv.getThreadTransaction().equals(txn4));
      xaEnv.end(xid4, XAResource.TMNOFLAGS);
      xaEnv.start(xid5, XAResource.TMRESUME);
      assertTrue(xaEnv.getThreadTransaction().equals(txn5));
      xaEnv.end(xid5, XAResource.TMNOFLAGS);

      /*
       * Check TMFAIL.
       */
      try {
View Full Code Here

       * Check TMFAIL.
       */
      try {
    xid = new XidImpl(1, "TwoPCTest6".getBytes(), null);
    xaEnv.start(xid, XAResource.TMNOFLAGS);
    xaEnv.end(xid, XAResource.TMFAIL);
    xaEnv.commit(xid, false);
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XA_RBROLLBACK);
      }
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.