Examples of JtxTransactionMode


Examples of jodd.jtx.JtxTransactionMode

  public void testNoTx() {

    final JtxTransactionManager manager = new JtxTransactionManager();
    manager.registerResourceManager(new DbJtxResourceManager(cp));

    JtxTransaction tx = manager.requestTransaction(new JtxTransactionMode().propagationSupports());
    assertTrue(tx.isNoTransaction());

    try {
      tx.commit();
    } catch (Exception ignore) {
      fail();
    }

    assertTrue(tx.isCommitted());

    try {
      tx.rollback();
      fail("exception is already committed!");
    } catch (Exception ignore) {
    }

    tx = manager.requestTransaction(new JtxTransactionMode().propagationSupports());

    try {
      tx.rollback();
    } catch (Exception ex) {
      fail(ex.toString());
    }

    tx = manager.requestTransaction(new JtxTransactionMode().propagationSupports());

    try {
      tx.setRollbackOnly();
    } catch (Exception ex) {
      fail(ex.toString());
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.