Package com.sleepycat.je

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


      XidImpl xid = new XidImpl(1, "TwoPCTest1".getBytes(), null);
            Transaction txn = null;

      /* Check that only one of TMJOIN and TMRESUME can be set. */
      try {
    xaEnv.start(xid, XAResource.TMJOIN | XAResource.TMRESUME);
    fail("Expected XAException(XAException.XAER_INVAL)");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_INVAL);
      }
View Full Code Here


      /*
       * Check that only one of TMJOIN and TMRESUME can be set by passing
       * a bogus flag value (TMSUSPEND).
       */
      try {
    xaEnv.start(xid, XAResource.TMSUSPEND);
    fail("Expected XAException(XAException.XAER_INVAL)");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_INVAL);
      }
View Full Code Here

      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_INVAL);
      }

      xaEnv.start(xid, XAResource.TMNOFLAGS);
      try {
    xaEnv.start(xid, XAResource.TMNOFLAGS);
    fail("Expected XAER_DUPID");
      } catch (XAException XAE) {
    /* Expect this. */
 
View Full Code Here

    assertTrue(XAE.errorCode == XAException.XAER_INVAL);
      }

      xaEnv.start(xid, XAResource.TMNOFLAGS);
      try {
    xaEnv.start(xid, XAResource.TMNOFLAGS);
    fail("Expected XAER_DUPID");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_DUPID);
      }
View Full Code Here

      /*
       * Check that JOIN with a non-existant association throws NOTA.
       */
      try {
    xid = new XidImpl(1, "TwoPCTest2".getBytes(), null);
    xaEnv.start(xid, XAResource.TMJOIN);
    fail("Expected XAER_NOTA");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_NOTA);
      }
View Full Code Here

      /*
       * Check that RESUME with a non-existant association throws NOTA.
       */
      try {
    xaEnv.start(xid, XAResource.TMRESUME);
    fail("Expected XAER_NOTA");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_NOTA);
      }
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);
View Full Code Here

       */
      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");
      } catch (XAException XAE) {
    /* Expect this. */
 
View Full Code Here

      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");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_PROTO);
      }
View Full Code Here

       * Check that start(RESUME) for an xid that is not suspended throws
       * XAER_PROTO.
       */
      try {
    xid = new XidImpl(1, "TwoPCTest2".getBytes(), null);
    xaEnv.start(xid, XAResource.TMRESUME);
    fail("Expected XAER_PROTO");
      } catch (XAException XAE) {
    /* Expect this. */
    assertTrue(XAE.errorCode == XAException.XAER_PROTO);
      }
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.