Package bitronix.tm

Examples of bitronix.tm.BitronixTransactionManager.begin()


        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

        Xid xid0 = new MockXid(0, uid0.getArray(), BitronixXid.FORMAT_ID);
        xaResource.addInDoubtXid(xid0);

        assertNull(btm.getCurrentTransaction());
        Thread.sleep(30); // let the clock run a bit so that in-flight TX is a bit older than the journaled one
        btm.begin();

        Xid xid1 = new MockXid(1, UidGenerator.generateUid().getArray(), BitronixXid.FORMAT_ID);
        xaResource.addInDoubtXid(xid1);

        TransactionManagerServices.getRecoverer().run();
View Full Code Here

        names.add(pds.getUniqueName());
        journal.log(Status.STATUS_COMMITTING, new Uid(xid0.getGlobalTransactionId()), names);

        assertNull(btm.getCurrentTransaction());
        Thread.sleep(30); // let the clock run a bit so that in-flight TX is a bit older than the journaled one
        btm.begin();

        Xid xid1 = new MockXid(1, UidGenerator.generateUid().getArray(), BitronixXid.FORMAT_ID);
        xaResource.addInDoubtXid(xid1);

        names = new HashSet();
View Full Code Here

        pds.setMaxPoolSize(2);
        BitronixTransactionManager btm = TransactionManagerServices.getTransactionManager();
        final Recoverer recoverer = TransactionManagerServices.getRecoverer();

        try {
            btm.begin();

            BitronixTransaction tx = btm.getCurrentTransaction();
            tx.addTransactionStatusChangeListener(new TransactionStatusChangeListener() {
                public void statusChanged(int oldStatus, int newStatus) {
                    if (newStatus != Status.STATUS_COMMITTING)
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.