Package net.sf.ehcache.transaction.local

Examples of net.sf.ehcache.transaction.local.LocalTransactionContext


        TransactionID txId = currentTransactionIdThreadLocal.get();
        if (txId != null) {
            throw new TransactionException("transaction already started");
        }

        LocalTransactionContext newTx = new LocalTransactionContext(transactionTimeoutSeconds, transactionIDFactory.createTransactionID());
        contextMap.put(newTx.getTransactionId(), newTx);
        currentTransactionIdThreadLocal.set(newTx.getTransactionId());

        MDC.put(MDC_KEY, newTx.getTransactionId().toString());
        LOG.debug("begun transaction {}", newTx.getTransactionId());
    }
View Full Code Here


        TransactionID txId = currentTransactionIdThreadLocal.get();
        if (txId == null) {
            throw new TransactionException("no transaction started");
        }

        LocalTransactionContext currentTx = contextMap.get(txId);

        try {
            currentTx.commit(ignoreTimeout);
            statistics.transactionCommitted();
        } catch (TransactionTimeoutException tte) {
            statistics.transactionTimedOut();
            statistics.transactionRolledBack();
            throw tte;
View Full Code Here

        TransactionID txId = currentTransactionIdThreadLocal.get();
        if (txId == null) {
            throw new TransactionException("no transaction started");
        }

        LocalTransactionContext currentTx = contextMap.get(txId);

        try {
            currentTx.rollback();
            statistics.transactionRolledBack();
        } finally {
            contextMap.remove(txId);
            currentTransactionIdThreadLocal.remove();
            MDC.remove(MDC_KEY);
View Full Code Here

        TransactionID txId = currentTransactionIdThreadLocal.get();
        if (txId == null) {
            throw new TransactionException("no transaction started");
        }

        LocalTransactionContext currentTx = contextMap.get(txId);

        currentTx.setRollbackOnly();
    }
View Full Code Here

TOP

Related Classes of net.sf.ehcache.transaction.local.LocalTransactionContext

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.