Package jodd.db.jtx

Examples of jodd.db.jtx.DbJtxTransaction


  DbSession s0;

  void service0() {
    assertTotals(0, 0);
    DbJtxTransaction tx = dbtxm.requestTransaction(new JtxTransactionMode().propagationRequired());
    assertTotals(1, 1);
    s0 = tx.requestResource();
    service0_1(tx);
    tx.commit();
    assertTotals(0, 0);
  }
View Full Code Here


    assertTotals(0, 0);
  }

  void service0_1(JtxTransaction uptx) {
    assertTotals(1, 1);
    DbJtxTransaction tx = dbtxm.requestTransaction(new JtxTransactionMode().propagationSupports());
    assertTotals(1, 1);
    assertEquals(uptx, tx);
    DbSession s1 = tx.requestResource();
    assertEquals(s0, s1);
  }
View Full Code Here

  DbSession s1;

  // service #1 REQUIRED
  JtxTransaction service1() {
    assertTotals(0, 0);
    DbJtxTransaction tx = dbtxm.requestTransaction(new JtxTransactionMode().propagationRequired());
    assertTotals(1, 1);
    s1 = tx.requestResource();
    return tx;
  }
View Full Code Here

  }

  // service #2 REQUIRES NEW
  void service2(JtxTransaction tx1) {
    assertTotals(1, 1);
    DbJtxTransaction tx = dbtxm.requestTransaction(new JtxTransactionMode().propagationRequiresNew());
    assertTotals(2, 2);
    assertNotSame(tx1, tx);
    assertNotSame(s1, tx.requestResource());
    tx.commit();
    assertTotals(1, 1);
  }
View Full Code Here

  }

  // service #3 REQUIRED
  void service3(JtxTransaction tx1) {
    assertTotals(1, 1);
    DbJtxTransaction tx = dbtxm.requestTransaction(new JtxTransactionMode().propagationRequired());
    assertEquals(tx1, tx);
    assertTotals(1, 1);
    assertEquals(s1, tx.requestResource());
    service3_1(tx);
    assertEquals(s1, tx.requestResource());
    assertTotals(1, 1);
  }
View Full Code Here

  }

  // service #3_1 NOT SUPPORTED
  void service3_1(JtxTransaction tx3) {
    assertTotals(1, 1);
    DbJtxTransaction tx = dbtxm.requestTransaction(new JtxTransactionMode().propagationNotSupported());
    assertNotSame(tx3, tx);
    assertTotals(2, 1);
    assertNotSame(s1, tx.requestResource());
    assertNotSame(s1, tx.requestResource());
    tx.commit();
    assertTotals(1, 1);
  }
View Full Code Here

TOP

Related Classes of jodd.db.jtx.DbJtxTransaction

Copyright © 2018 www.massapicom. 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.