Examples of totalTransactions()


Examples of jodd.db.jtx.DbJtxTransactionManager.totalTransactions()

    DbManager.getInstance().setSessionProvider(sessionProvider);

    for (int i = 0; i < 2; i++) {

      // start, 0 transactions, no session
      assertEquals(0, jtxManager.totalTransactions());

      // start transaction
      jtxManager.requestTransaction(new JtxTransactionMode());

      // get session from provider!
View Full Code Here

Examples of jodd.db.jtx.DbJtxTransactionManager.totalTransactions()

      // get session from provider!
      DbSession dbSession = sessionProvider.getDbSession();
      assertNotNull(dbSession);

      // transaction started, but connection not yet fetched as it is not used yet
      assertEquals(1, jtxManager.totalTransactions());
      assertEquals(0, cp.getConnectionsCount().getBusyCount());

      // same session as it is the same transaction
      DbSession dbSession2 = sessionProvider.getDbSession();
      assertNotNull(dbSession2);
View Full Code Here

Examples of jodd.db.jtx.DbJtxTransactionManager.totalTransactions()

      long value = dbQuery.executeCount();
      assertEquals(173, value);
      assertSame(dbSession, dbQuery.getSession());

      // transaction still active, connection still in use
      assertEquals(1, jtxManager.totalTransactions());
      assertEquals(1, cp.getConnectionsCount().getBusyCount());

      // close query
      dbQuery.close();
View Full Code Here

Examples of jodd.db.jtx.DbJtxTransactionManager.totalTransactions()

      // close query
      dbQuery.close();

      // transaction still active, connection still in use (!)
      // since session is still active
      assertEquals(1, jtxManager.totalTransactions());
      assertEquals(1, cp.getConnectionsCount().getBusyCount());
      assertTrue(!dbQuery.getSession().isSessionClosed());

      // commit transaction...
      jtxManager.getTransaction().commit();
View Full Code Here

Examples of jodd.db.jtx.DbJtxTransactionManager.totalTransactions()

      // commit transaction...
      jtxManager.getTransaction().commit();

      // no transaction
      assertEquals(0, jtxManager.totalTransactions());
      // session is closed
      assertTrue(dbSession.isSessionClosed());
      // connection is returned
      assertEquals(0, cp.getConnectionsCount().getBusyCount());
    }
View Full Code Here

Examples of jodd.jtx.JtxTransactionManager.totalTransactions()

    DbManager.getInstance().setSessionProvider(sessionProvider);

    for (int i = 0; i < 2; i++) {

      // start, 0 transactions, no session
      assertEquals(0, jtxManager.totalTransactions());

      // start transaction
      jtxManager.requestTransaction(new JtxTransactionMode());

      // get session from provider!
View Full Code Here

Examples of jodd.jtx.JtxTransactionManager.totalTransactions()

      // get session from provider!
      DbSession dbSession = sessionProvider.getDbSession();
      assertNotNull(dbSession);

      // transaction started, but connection not yet fetched as it is not used yet
      assertEquals(1, jtxManager.totalTransactions());
      assertEquals(0, cp.getConnectionsCount().getBusyCount());

      // same session as it is the same transaction
      DbSession dbSession2 = sessionProvider.getDbSession();
      assertNotNull(dbSession2);
View Full Code Here

Examples of jodd.jtx.JtxTransactionManager.totalTransactions()

      long value = dbQuery.executeCount();
      assertEquals(173, value);
      assertSame(dbSession, dbQuery.getSession());

      // transaction still active, connection still in use
      assertEquals(1, jtxManager.totalTransactions());
      assertEquals(1, cp.getConnectionsCount().getBusyCount());

      // close query
      dbQuery.close();
View Full Code Here

Examples of jodd.jtx.JtxTransactionManager.totalTransactions()

      // close query
      dbQuery.close();

      // transaction still active, connection still in use (!)
      // since session is still active
      assertEquals(1, jtxManager.totalTransactions());
      assertEquals(1, cp.getConnectionsCount().getBusyCount());
      assertTrue(!dbQuery.getSession().isSessionClosed());

      // commit transaction...
      jtxManager.getTransaction().commit();
View Full Code Here

Examples of jodd.jtx.JtxTransactionManager.totalTransactions()

      // commit transaction...
      jtxManager.getTransaction().commit();

      // no transaction
      assertEquals(0, jtxManager.totalTransactions());
      // session is closed
      assertTrue(dbSession.isSessionClosed());
      // connection is returned
      assertEquals(0, cp.getConnectionsCount().getBusyCount());
    }
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.