Package jodd.db.jtx

Examples of jodd.db.jtx.DbJtxResourceManager


   */
  @Test
  public void testRollback() throws SQLException {
    // prepare manager
    JtxTransactionManager manager = new JtxTransactionManager();
    manager.registerResourceManager(new DbJtxResourceManager(cp));

    // request transaction
    JtxTransaction tx = manager.requestTransaction(new JtxTransactionMode().propagationRequired().readOnly(false));
    DbSession session = tx.requestResource(DbSession.class);
    assertNotNull(session);
View Full Code Here


  // ---------------------------------------------------------------- test time
  @Test
  public void testTime() {
    JtxTransactionManager manager = new JtxTransactionManager();
    manager.registerResourceManager(new DbJtxResourceManager(cp));

    JtxTransaction tx1 = manager.requestTransaction(new JtxTransactionMode().propagationRequired().transactionTimeout(1));
    DbSession session1 = tx1.requestResource(DbSession.class);
    assertNotNull(session1);
    executeCount(session1, "select count(*) from GIRL");
View Full Code Here

  // ---------------------------------------------------------------- thread
  @Test
  public void testThread() {
    final JtxTransactionManager manager = new JtxTransactionManager();
    manager.registerResourceManager(new DbJtxResourceManager(cp));
    final int[] count = new int[1];

    new Thread() {
      @Override
      public void run() {
View Full Code Here

  // ---------------------------------------------------------------- notx
  @Test
  public void testNoTx() {

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

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

    try {
View Full Code Here

TOP

Related Classes of jodd.db.jtx.DbJtxResourceManager

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.