Package org.apache.geronimo.transaction.context

Examples of org.apache.geronimo.transaction.context.UnspecifiedTransactionContext


        }
        BeanTransactionContext beanContext = (BeanTransactionContext) ctx;
        try {
            beanContext.commit();
        } finally {
            UnspecifiedTransactionContext oldContext = beanContext.getOldContext();
            transactionContextManager.setContext(oldContext);
            oldContext.resume();
        }
    }
View Full Code Here


        }
        BeanTransactionContext beanContext = (BeanTransactionContext) ctx;
        try {
            beanContext.rollback();
        } finally {
            UnspecifiedTransactionContext oldContext = beanContext.getOldContext();
            transactionContextManager.setContext(oldContext);
            oldContext.resume();
        }
    }
View Full Code Here

    private ManagedConnectionInfo getSharedManagedConnectionInfo(ContainerTransactionContext transactionContext) {
        return ((TransactionCachingInterceptor.ManagedConnectionInfos)transactionContext.getManagedConnectionInfo(transactionCachingInterceptor)).getShared();
    }

    public void testGetConnectionOutsideTransaction() throws Exception {
        TransactionContext.setContext(new UnspecifiedTransactionContext());
        ConnectionInfo connectionInfo1 = makeConnectionInfo();
        transactionCachingInterceptor.getConnection(connectionInfo1);
        assertTrue("Expected to get an initial connection", obtainedConnectionInfo != null);
        assertTrue("Expected nothing returned yet", returnedConnectionInfo == null);
        assertTrue("Expected no ManagedConnectionInfo in the TransactionContext",
View Full Code Here

    private Object mutex = new Object();

    private Exception e = null;

    public void testNoTransactionCallOneThread() throws Throwable {
        TransactionContext.setContext(new UnspecifiedTransactionContext());
        for (int i = 0; i < repeatCount; i++) {
            defaultComponentInterceptor.invoke(defaultComponentContext);
        }
    }
View Full Code Here

        startedThreads = 0;
        stoppedThreads = 0;
        for (int t = 0; t < threadCount; t++) {
            new Thread() {
                public void run() {
                    TransactionContext.setContext(new UnspecifiedTransactionContext());
                    long localStartTime = 0;
                    int localSlowCount = 0;
                    try {
                        synchronized (startBarrier) {
                            ++startedThreads;
View Full Code Here

    private ManagedConnectionInfo getSharedManagedConnectionInfo(ContainerTransactionContext transactionContext) {
        return ((TransactionCachingInterceptor.ManagedConnectionInfos)transactionContext.getManagedConnectionInfo(transactionCachingInterceptor)).getShared();
    }

    public void testGetConnectionOutsideTransaction() throws Exception {
        TransactionContext.setContext(new UnspecifiedTransactionContext());
        ConnectionInfo connectionInfo1 = makeConnectionInfo();
        transactionCachingInterceptor.getConnection(connectionInfo1);
        assertTrue("Expected to get an initial connection", obtainedConnectionInfo != null);
        assertTrue("Expected nothing returned yet", returnedConnectionInfo == null);
        assertTrue("Expected no ManagedConnectionInfo in the TransactionContext",
View Full Code Here

        committed = false;
    }

    public void testNoTransaction() throws Exception {
        ConnectionInfo connectionInfo = makeConnectionInfo();
        TransactionContext.setContext(new UnspecifiedTransactionContext());
        transactionEnlistingInterceptor.getConnection(connectionInfo);
        assertTrue("Expected not started", !started);
        assertTrue("Expected not ended", !ended);
        transactionEnlistingInterceptor.returnConnection(connectionInfo, ConnectionReturnAction.RETURN_HANDLE);
        assertTrue("Expected returned", returned);
View Full Code Here

    private Object mutex = new Object();

    private Exception e = null;

    public void testNoTransactionCallOneThread() throws Throwable {
        TransactionContext.setContext(new UnspecifiedTransactionContext());
        for (int i = 0; i < repeatCount; i++) {
            defaultComponentInterceptor.invoke(defaultComponentContext);
        }
    }
View Full Code Here

        startedThreads = 0;
        stoppedThreads = 0;
        for (int t = 0; t < threadCount; t++) {
            new Thread() {
                public void run() {
                    TransactionContext.setContext(new UnspecifiedTransactionContext());
                    long localStartTime = 0;
                    int localSlowCount = 0;
                    try {
                        synchronized (startBarrier) {
                            ++startedThreads;
View Full Code Here

        this.trackedConnectionAssociator = trackedConnectionAssociator;
    }

    public Object invoke(InstanceContext newInstanceContext) throws Throwable {
        if (TransactionContext.getContext() == null) {
            TransactionContext.setContext(new UnspecifiedTransactionContext());
        }
        InstanceContext oldInstanceContext = trackedConnectionAssociator.enter(newInstanceContext);
        try {
            return next.invoke(newInstanceContext);
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.transaction.context.UnspecifiedTransactionContext

Copyright © 2018 www.massapicom. 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.