Package bitronix.tm

Examples of bitronix.tm.BitronixTransactionManager.begin()


        poolingDataSource1.setUseTmJoin(false);

        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();
        connection1.createStatement();
View Full Code Here


    public void testReEnlistmentAfterSuspend() 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();
        connection1.createStatement();
View Full Code Here

        if (log.isDebugEnabled()) { log.debug("*** suspending"); }
        Transaction t1 = tm.suspend();

        if (log.isDebugEnabled()) { log.debug("*** before begin2"); }
        tm.begin();
        if (log.isDebugEnabled()) { log.debug("*** after begin2"); }
        if (log.isDebugEnabled()) { log.debug("*** reusing connection 1"); }
        connection1.createStatement();
        if (log.isDebugEnabled()) { log.debug("*** marking subTX as rollback only"); }
        tm.setRollbackOnly();
View Full Code Here

    public void testClosingSuspendedConnections() 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("*** getting connection from DS1"); }
        Connection connection1 = poolingDataSource1.getConnection();
        connection1.createStatement();

View Full Code Here

    public void testInterleavedLocalGlobalTransactions() 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();
        connection1.createStatement();
View Full Code Here

    public void testInterleavedGlobalGlobalTransactionsWithDifferentConnections() 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();
        connection1.createStatement();
View Full Code Here

        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();
        connection2.createStatement();
        connection2.close();
        if (log.isDebugEnabled()) { log.debug(" *** commit interleaved transaction"); }
        tm.commit();
View Full Code Here

    public void testInterleavedGlobalGlobalTransactionsWithDifferentConnectionsLateSuspend() 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();
        connection1.createStatement();
View Full Code Here

        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

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.