Package javax.transaction

Examples of javax.transaction.NotSupportedException


        }

        public void begin() throws NotSupportedException, SystemException {
            TransactionContext ctx = TransactionContext.getContext();
            if (ctx instanceof UnspecifiedTransactionContext == false) {
                throw new NotSupportedException("Previous Transaction has not been committed");
            }
            UnspecifiedTransactionContext oldContext = (UnspecifiedTransactionContext) ctx;
            BeanTransactionContext newContext = new BeanTransactionContext(txnManager, oldContext);
            oldContext.suspend();
            try {
View Full Code Here


        return (tx != null) ? tx.getStatus() : Status.STATUS_NO_TRANSACTION;
    }

    public void begin() throws NotSupportedException, SystemException {
        if (getStatus() != Status.STATUS_NO_TRANSACTION) {
            throw new NotSupportedException("Nested Transactions are not supported");
        }
        TransactionImpl tx = new TransactionImpl(xidFactory, txnLog);
        threadTx.set(tx);
    }
View Full Code Here

                throw new IllegalStateException("SpringBeanTransactionPolicy transaction has been completed");
            }

            if (beanTransaction != null) {
                // we could support nested transactions
                throw new NotSupportedException("Current thread is already associated with a transaction");
            }

            try {
                // create transaction definition
                DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
View Full Code Here

*/
public class JTAManagedRuntime implements ManagedRuntime {
    private SimpleTransactionManager txm = new SimpleTransactionManager();
   
    public void doNonTransactionalWork(Runnable runnable) throws NotSupportedException {
        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

     * RegistryManagedRuntime cannot suspend transactions.
     * </P>
     */
    public void doNonTransactionalWork(Runnable runnable)
        throws NotSupportedException {
        throw new NotSupportedException(_loc.get("tsr-cannot-suspend")
            .getMessage());
    }
View Full Code Here

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

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

        return (tx != null) ? tx.getStatus() : Status.STATUS_NO_TRANSACTION;
    }

    public void begin() throws NotSupportedException, SystemException {
        if (getStatus() != Status.STATUS_NO_TRANSACTION) {
            throw new NotSupportedException("Nested Transactions are not supported");
        }
        TransactionImpl tx = new TransactionImpl(xidFactory, txnLog);
        threadTx.set(tx);
    }
View Full Code Here

        tx.setRollbackOnly();
    }

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

        MyTransaction tx = new MyTransaction();
        threadTransaction.set(tx);
    }
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.