Package bitronix.tm

Examples of bitronix.tm.BitronixTransactionManager.begin()


        if (log.isDebugEnabled()) log.debug(" *** suspending transaction");
        Transaction t1 = tm.suspend();
        assertNull(tm.getTransaction());

        if (log.isDebugEnabled()) log.debug(" *** begin interleaved transaction");
        tm.begin();
        Connection connection2 = poolingDataSource1.getConnection();
        assertEquals(POOL_SIZE -2, getPool(poolingDataSource1).inPoolSize());
        connection2.createStatement();
        connection2.close();
        if (log.isDebugEnabled()) log.debug(" *** commit interleaved transaction");
View Full Code Here


        assertEquals(DATASOURCE1_NAME, ((ConnectionQueuedEvent) orderedEvents.get(i++)).getPooledConnectionImpl().getPoolingDataSource().getUniqueName());
    }

    public void testJoinAfterSuspend() throws Exception {
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
        tm.begin();

        if (log.isDebugEnabled()) log.debug("*** get C1");
        Connection c1 = poolingDataSource1.getConnection();
        c1.createStatement();
        c1.close();
View Full Code Here

    public void testReusePreparedStatementAfterSuspendResume() throws Exception {
        if (log.isDebugEnabled()) log.debug("*** getting TM");
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();

        if (log.isDebugEnabled()) log.debug("*** before begin");
        tm.begin();
        if (log.isDebugEnabled()) log.debug("*** after begin");

        if (log.isDebugEnabled()) log.debug("*** getting connection from DS1");
        Connection connection1 = poolingDataSource1.getConnection();

View Full Code Here

    public void testSimpleWorkingCase() throws Exception {
        if (log.isDebugEnabled()) log.debug("*** getting TM");
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
        if (log.isDebugEnabled()) log.debug("*** before begin");
        tm.setTransactionTimeout(10);
        tm.begin();
        if (log.isDebugEnabled()) log.debug("*** after begin");

        if (log.isDebugEnabled()) log.debug("*** getting connection from CF1");
        Connection connection1 = poolingConnectionFactory1.createConnection();

View Full Code Here

        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();

        XAPool pool1 = getPool(poolingDataSource1);

        if (log.isDebugEnabled()) log.debug("*** before begin");
        tm.begin();
        if (log.isDebugEnabled()) log.debug("*** after begin");

        assertEquals(POOL_SIZE, pool1.inPoolSize());

        if (log.isDebugEnabled()) log.debug("*** getting connection from DS1");
View Full Code Here

        // Use DataSource2 because it does not have shared accessible connections
        XAPool pool2 = getPool(poolingDataSource2);

        if (log.isDebugEnabled()) log.debug("*** before begin");
        tm.begin();
        if (log.isDebugEnabled()) log.debug("*** after begin");

        assertEquals(POOL_SIZE, pool2.inPoolSize());

        if (log.isDebugEnabled()) log.debug("*** getting connection 1 from DS1");
View Full Code Here

    public void testConnectionCloseInDifferentContext() throws Exception {
        if (log.isDebugEnabled()) log.debug("*** getting TM");
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
        if (log.isDebugEnabled()) log.debug("*** beginning");
        tm.begin();

        if (log.isDebugEnabled()) log.debug("*** getting connection from DS1");
        Connection connection1 = poolingDataSource1.getConnection();
        connection1.createStatement();

View Full Code Here

        if (log.isDebugEnabled()) log.debug("*** committing");
        tm.commit();
        if (log.isDebugEnabled()) log.debug("*** TX is done");

        if (log.isDebugEnabled()) log.debug("*** beginning");
        tm.begin();


        if (log.isDebugEnabled()) log.debug("*** closing connection 1");
        connection1.close();

View Full Code Here

    public void testClosingSuspendedConnectionsInDifferentContext() throws Exception {
        if (log.isDebugEnabled()) log.debug("*** getting TM");
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();

        if (log.isDebugEnabled()) log.debug("*** before begin");
        tm.begin();

        XAPool pool1 = getPool(poolingDataSource1);

        assertEquals(POOL_SIZE, pool1.inPoolSize());

View Full Code Here

        Transaction t1 = tm.suspend();

        assertEquals(POOL_SIZE -1, pool1.inPoolSize());

        if (log.isDebugEnabled()) log.debug("*** starting 2nd tx");
        tm.begin();

        assertEquals(POOL_SIZE -1, pool1.inPoolSize());

        if (log.isDebugEnabled()) log.debug("*** closing connection 1 too eagerly within another context");
        try {
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.