Package bitronix.tm

Examples of bitronix.tm.BitronixTransactionManager.begin()


    protected void beginTransaction() throws Exception {
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
        if (tm.getStatus() != Status.STATUS_NO_TRANSACTION) {
            throw new RuntimeException("Active transaction in progress! Please commit or roll it back!");
        }
        tm.begin();
    }

    protected void commitTransaction() throws Exception {
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
        if (tm.getStatus() != Status.STATUS_ACTIVE) {
View Full Code Here


        Thread.currentThread().setName("testSimpleWorkingCase");
        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 DS1"); }
        Connection connection1 = poolingDataSource1.getConnection();
        if (log.isDebugEnabled()) { log.debug("*** creating statement 1 on connection 1"); }
View Full Code Here

        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 DS1"); }
        Connection connection1 = poolingDataSource1.getConnection();
        if (log.isDebugEnabled()) { log.debug("*** creating statement 1 on connection 1"); }
View Full Code Here

        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 DS1"); }
        Connection connection1 = poolingDataSource1.getConnection();
        if (log.isDebugEnabled()) { log.debug("*** creating statement 1 on connection 1"); }
View Full Code Here

        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 DS2"); }
        Connection connection2 = poolingDataSource2.getConnection();
        if (log.isDebugEnabled()) { log.debug("*** creating statement 1 on connection 2"); }
View Full Code Here

        Thread.currentThread().setName("testStatementTimeout");
        if (log.isDebugEnabled()) { log.debug("*** getting TM"); }
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
        if (log.isDebugEnabled()) { log.debug("*** before begin"); }
        tm.setTransactionTimeout(1);
        tm.begin();
        if (log.isDebugEnabled()) { log.debug("*** after begin"); }

        if (log.isDebugEnabled()) { log.debug("*** getting connection from DS1"); }
        Connection connection1 = poolingDataSource1.getConnection();
        if (log.isDebugEnabled()) { log.debug("*** creating statement 1 on connection 1"); }
View Full Code Here

        Thread.currentThread().setName("testCommitTimeout");
        if (log.isDebugEnabled()) { log.debug("*** getting TM"); }
        BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
        if (log.isDebugEnabled()) { log.debug("*** before begin"); }
        tm.setTransactionTimeout(1);
        tm.begin();
        if (log.isDebugEnabled()) { log.debug("*** after begin"); }

        if (log.isDebugEnabled()) { log.debug("*** getting connection from DS1"); }
        Connection connection1 = poolingDataSource1.getConnection();
        if (log.isDebugEnabled()) { log.debug("*** creating statement 1 on connection 1"); }
View Full Code Here

        connection1.close();
        if (log.isDebugEnabled()) { log.debug("*** closing connection 2"); }
        connection2.close();

        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 in global ctx"); }
        connection1 = poolingDataSource1.getConnection();
        connection1.createStatement();
View Full Code Here

    public void testDeferredReleaseAfterMarkedRollback() throws Exception {
        Thread.currentThread().setName("testDeferredReleaseAfterMarkedRollback");
        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 testRollingBackSynchronization() throws Exception {
        Thread.currentThread().setName("testRollingBackSynchronization");
        if (log.isDebugEnabled()) { log.debug("*** getting TM"); }
        final BitronixTransactionManager tm = TransactionManagerServices.getTransactionManager();
        if (log.isDebugEnabled()) { log.debug("*** before begin"); }
        tm.begin();
        if (log.isDebugEnabled()) { log.debug("*** after begin"); }

        tm.getTransaction().registerSynchronization(new Synchronization() {
            public void beforeCompletion() {
                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.