Examples of LocalTransactionContext


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

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

        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

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

        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

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

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

        LocalTransactionContext currentTx = contextMap.get(txId);

        currentTx.setRollbackOnly();
    }
View Full Code Here

Examples of org.castor.persist.LocalTransactionContext

            final boolean autoStore)
    throws DatabaseNotFoundException {
       
        super(dbName, lockTimeout, callback, instanceFactory, classLoader, autoStore);
       
        _ctx = new LocalTransactionContext(this);
       
        _ctx.setLockTimeout(_lockTimeout);
        _ctx.setAutoStore(_autoStore);
        _ctx.setCallback(_callback);
        _ctx.setInstanceFactory(_instanceFactory);
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.