Package bitronix.tm

Examples of bitronix.tm.BitronixTransactionManager.suspend()


        connection1.createStatement();

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

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

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

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


        if (log.isDebugEnabled()) { log.debug("*** getting connection from DS2"); }
        Connection connection2 = poolingDataSource2.getConnection();
        connection2.createStatement();

        if (log.isDebugEnabled()) { log.debug("*** suspending transaction"); }
        Transaction tx = tm.suspend();
        if (log.isDebugEnabled()) { log.debug("*** resuming transaction"); }
        tm.resume(tx);

        if (log.isDebugEnabled()) { log.debug("*** closing connection 1"); }
        connection1.close();
View Full Code Here

        tm.begin();

        Connection c = poolingDataSource1.getConnection();
        c.prepareStatement("");

        Transaction tx = tm.suspend();
        assertNull(tm.getTransaction());

        assertTrue(c.getAutoCommit());

        tm.resume(tx);
View Full Code Here

        Connection connection1 = poolingDataSource1.getConnection();
        connection1.createStatement();
        Connection connection2 = poolingDataSource2.getConnection();
        connection2.createStatement();

        Transaction tx = tm.suspend();

        assertNull(tm.suspend());

        try {
            tm.resume(null);
View Full Code Here

        Connection connection2 = poolingDataSource2.getConnection();
        connection2.createStatement();

        Transaction tx = tm.suspend();

        assertNull(tm.suspend());

        try {
            tm.resume(null);
            fail("TM has allowed resuming a null TX context");
        } catch (InvalidTransactionException ex) {
View Full Code Here

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

        assertNull(tm.suspend());

        try {
            tm.resume(null);
            fail("expected InvalidTransactionException");
        } catch (InvalidTransactionException ex) {
View Full Code Here

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

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

        if (log.isDebugEnabled()) { log.debug("*** resuming"); }
        tm.resume(t1);

        connection1.createStatement();
View Full Code Here

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

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

        if (log.isDebugEnabled()) { log.debug("*** resuming"); }
        tm.resume(t1);

        connection1.createStatement();
View Full Code Here

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

        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"); }
View Full Code Here

        connection1.createStatement();

        assertEquals(POOL_SIZE -1, getPool(poolingDataSource1).inPoolSize());

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

        assertEquals(POOL_SIZE -1, getPool(poolingDataSource1).inPoolSize());

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