Package org.apache.geronimo.transaction.context

Examples of org.apache.geronimo.transaction.context.TransactionContext.commit()


        for (int i = 0; i < workInfos.length; i++) {
            workInfos[i].getExecutorFeedingTimerTask().cancel();
        }
        Thread.sleep(SLOP + DELAY);
        assertEquals(COUNT, counter.get());
        transactionContext.commit();
        Thread.sleep(SLOP + DELAY);
        assertEquals(COUNT, counter.get());
    }

    public void testCancelInRolledBackTransaction() throws Exception {
View Full Code Here


        started = false;
        transactionEnlistingInterceptor.returnConnection(connectionInfo, ConnectionReturnAction.RETURN_HANDLE);
        assertTrue("Expected not started", !started);
        assertTrue("Expected ended", ended);
        assertTrue("Expected returned", returned);
        transactionContext.commit();
        assertTrue("Expected committed", committed);
    }

    public void testTransactionUnshareableConnection() throws Exception {
        TransactionContext transactionContext = transactionContextManager.newContainerTransactionContext();
View Full Code Here

        started = false;
        transactionEnlistingInterceptor.returnConnection(connectionInfo, ConnectionReturnAction.RETURN_HANDLE);
        assertTrue("Expected not started", !started);
        assertTrue("Expected ended", ended);
        assertTrue("Expected returned", returned);
        transactionContext.commit();
        assertTrue("Expected committed", committed);
    }

    //ConnectionInterceptor
    public void getConnection(ConnectionInfo connectionInfo) throws ResourceException {
View Full Code Here

            jndiContext.stopClient(appClientModuleName);

            thread.setContextClassLoader(oldClassLoader);
            transactionContextManager.setContext(oldTransactionContext);
            if (currentTransactionContext != null) {
                currentTransactionContext.commit();
            }
            ContextManager.popCallers(oldCallers);
        }
    }
View Full Code Here

                    if (newTransactionContext != transactionContextManager.getContext()) {
                        transactionContextManager.getContext().rollback();
                        newTransactionContext.rollback();
                        throw new RuntimeException("WRONG EXCEPTION! returned from servlet call with wrong tx context");
                    }
                    newTransactionContext.commit();

                } else {
                    if (oldTransactionContext != transactionContextManager.getContext()) {
                        if (transactionContextManager.getContext() != null) {
                            transactionContextManager.getContext().rollback();
View Full Code Here

            if (workInfo.isOneTime()) {
                threadPooledTimer.removeWorkInfo(workInfo);
            }
        } finally {
            try {
                transactionContext.commit();
            } catch (Exception e) {
                log.error("Unable to commit transaction context", e);
            }
            transactionContextManager.setContext(oldTransactionContext);
        }
View Full Code Here

                    log.warn("Exception occured while updating timer persistent state", e);
                }
            } finally {
                try {
                    transactionContextManager.setContext(null);
                    if (transactionContext.commit()) {
                        if (workInfo.isOneTime()) {
                            threadPooledTimer.removeWorkInfo(workInfo);
                        }
                        // todo this is a very weird code structure.... returning from a finally is very confusing
                        return;
View Full Code Here

                trackedConnectionAssociator.exit(oldInstanceContext);
            }
        } finally {
            if (transactionContext == null) {
                transactionContext = transactionContextManager.getContext();
                transactionContext.commit();
                transactionContextManager.setContext(null);
            }
        }
    }
}
View Full Code Here

        for (long i = 0; i < COUNT; i++) {
            timer.schedule(userTaskFactory, key, userId, userKey, i);
        }
        Thread.currentThread().sleep(COUNT + SLOP);
        assertEquals(0, counter.get());
        transactionContext.commit();
        Thread.currentThread().sleep(COUNT + SLOP);
        assertEquals(COUNT, counter.get());
    }

    public void testCancelInCommittedTransaction() throws Exception {
View Full Code Here

        for (int i = 0; i < workInfos.length; i++) {
            workInfos[i].getExecutorFeedingTimerTask().cancel();
        }
        Thread.currentThread().sleep(SLOP + DELAY);
        assertEquals(COUNT, counter.get());
        transactionContext.commit();
        Thread.currentThread().sleep(SLOP + DELAY);
        assertEquals(COUNT, counter.get());
    }

    public void testCancelInRolledBackTransaction() throws Exception {
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.