Package net.sf.ehcache.transaction

Examples of net.sf.ehcache.transaction.TransactionException


            return put;
        } catch (CacheException e) {
            setRollbackOnly();
            throw e;
        } catch (RollbackException e) {
            throw new TransactionException("error registering writer synchronization", e);
        } catch (SystemException e) {
            throw new TransactionException("error registering writer synchronization", e);
        }
    }
View Full Code Here


            return removed;
        } catch (CacheException e) {
            setRollbackOnly();
            throw e;
        } catch (RollbackException e) {
            throw new TransactionException("error registering writer synchronization", e);
        } catch (SystemException e) {
            throw new TransactionException("error registering writer synchronization", e);
        }
    }
View Full Code Here

     * @param transactionTimeoutSeconds the timeout foe this transaction in seconds
     */
    public void begin(int transactionTimeoutSeconds) {
        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());
View Full Code Here

     * @param ignoreTimeout true if the transaction should be committed no matter if it timed out or not
     */
    public void commit(boolean ignoreTimeout) {
        TransactionID txId = currentTransactionIdThreadLocal.get();
        if (txId == null) {
            throw new TransactionException("no transaction started");
        }

        LocalTransactionContext currentTx = contextMap.get(txId);

        try {
View Full Code Here

     * Rollback the transaction bound to the current thread
     */
    public void rollback() {
        TransactionID txId = currentTransactionIdThreadLocal.get();
        if (txId == null) {
            throw new TransactionException("no transaction started");
        }

        LocalTransactionContext currentTx = contextMap.get(txId);

        try {
View Full Code Here

     * Mark the transaction bound to the current thread for rollback only
     */
    public void setRollbackOnly() {
        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.TransactionException

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.