Package javax.transaction

Examples of javax.transaction.NotSupportedException


        // Unsupported methods follow
        //////////////////////////////

        public void begin()
            throws NotSupportedException, SystemException {
            throw new NotSupportedException();
        }
View Full Code Here


       
        try {
            tm = getTransactionManager();
        }
        catch(Exception e) {
            NotSupportedException nse =
                new NotSupportedException(e.getMessage());
            nse.initCause(e);
            throw nse;
        }
        try {
            transaction = tm.suspend();
        } catch (Exception e) {
            NotSupportedException nse = new NotSupportedException
                    _loc.get("exc-suspend-tran", e.getClass()).getMessage());
            nse.initCause(e);
            throw nse;
        }
       
        runnable.run();
       
        try {
            tm.resume(transaction);
        } catch (Exception e) {
            try {
                transaction.setRollbackOnly();
            }
            catch(SystemException se2) {
                throw new GeneralException(se2);
            }
            NotSupportedException nse =
                new NotSupportedException(
                        _loc.get("exc-resume-tran", e.getClass()).getMessage());
            nse.initCause(e);
            throw nse;
        }

    }
View Full Code Here

            throws NotSupportedException {
        // Obtain a transaction manager to initialize the runtime.
        try {
            getTransactionManager();
        } catch (Exception e) {
            NotSupportedException nse =
                new NotSupportedException(_loc
                        .get("tm-unavailable", _runtime).getMessage());
            nse.initCause(e);
            throw nse;
        }
        _runtime.doNonTransactionalWork(runnable);
    }
View Full Code Here

    public void begin()
        throws NotSupportedException, SystemException {

        Transaction currentTransaction = getTransaction();
        if (currentTransaction != null)
            throw new NotSupportedException();

        currentTransaction = new SlideTransaction(this);
        bindings.put(Thread.currentThread(), currentTransaction);

        if (logger.isEnabled(LOG_CHANNEL, Logger.DEBUG)) {
View Full Code Here

    public void begin()
        throws NotSupportedException, SystemException {

        Transaction currentTransaction = getTransaction();
        if (currentTransaction != null)
            throw new NotSupportedException();

        currentTransaction = new SlideTransaction(this);
        bindings.put(Thread.currentThread(), currentTransaction);

        if (logger.isEnabled(LOG_CHANNEL, Logger.DEBUG)) {
View Full Code Here

public class MockTransactionManager implements TransactionManager {
    ThreadLocal<TX> _transaction = new ThreadLocal<TX>();

    public void begin() throws NotSupportedException, SystemException {
        if (_transaction.get() != null)
            throw new NotSupportedException("Transaction active (nested tx not supported): " + _transaction.get());

        _transaction.set(new TX());
    }
View Full Code Here

        begin(getTransactionTimeoutMilliseconds(0L));
    }

    public Transaction begin(long transactionTimeoutMilliseconds) throws NotSupportedException, SystemException {
        if (getStatus() != Status.STATUS_NO_TRANSACTION) {
            throw new NotSupportedException("Nested Transactions are not supported");
        }
        TransactionImpl tx = new TransactionImpl(xidFactory, transactionLog, getTransactionTimeoutMilliseconds(transactionTimeoutMilliseconds));
//        timeoutTimer.schedule(tx, getTransactionTimeoutMilliseconds(transactionTimeoutMilliseconds));
        try {
            associate(tx);
View Full Code Here

            throws NotSupportedException {
        // Obtain a transaction manager to initialize the runtime.
        try {
            getTransactionManager();
        } catch (Exception e) {
            NotSupportedException nse =
                new NotSupportedException(_loc
                        .get("tm-unavailable", _runtime).getMessage());
            nse.initCause(e);
            throw nse;
        }
        _runtime.doNonTransactionalWork(runnable);
    }
View Full Code Here

        tx.setRollbackOnly();
    }

    public void begin() throws NotSupportedException {
        if (threadTransaction.get() != null) {
            throw new NotSupportedException("A transaction is already active");
        }

        final MyTransaction tx = new MyTransaction();
        threadTransaction.set(tx);
    }
View Full Code Here

    public void begin()
        throws NotSupportedException, SystemException {

        Transaction currentTransaction = getTransaction();
        if (currentTransaction != null)
            throw new NotSupportedException();

        currentTransaction = new SlideTransaction();
        bindings.put(Thread.currentThread(), currentTransaction);

    }
View Full Code Here

TOP

Related Classes of javax.transaction.NotSupportedException

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.