Package javax.transaction

Examples of javax.transaction.NotSupportedException


    @Test( expected = RuntimeException.class )
    public void beginWithNotSupportedException()
        throws Exception
    {
        doThrow( new NotSupportedException() ).when( txn ).begin();
        sut.begin();
    }
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

    *          If the transaction service fails in an unexpected way.
    */
   public void begin() throws NotSupportedException, SystemException {
      Transaction currentTx;
      if ((currentTx = getTransaction()) != null)
         throw new NotSupportedException(Thread.currentThread() +
               " is already associated with a transaction (" + currentTx + ")");
      DummyTransaction tx = new DummyTransaction(this);
      setTransaction(tx);
   }
View Full Code Here

      } catch (Throwable e) {
        log.log(Level.WARNING, e.toString(), e);
      }
      */

      throw new NotSupportedException(
          L.l("{0} nested transactions are not supported. "
              + "The previous transaction for this thread did not commit() or rollback(). "
              + "Check that every UserTransaction.begin() has its commit() or rollback() in a finally block.\nStatus was {1}.",
              this, xaState(status)));
    }
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

            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

    if (transactionContextManager.getContext() == null) {
      transactionContextManager.newUnspecifiedTransactionContext();
    }
        TransactionContext ctx = transactionContextManager.getContext();
        if (ctx instanceof UnspecifiedTransactionContext == false) {
            throw new NotSupportedException("Previous Transaction has not been committed");
        }
        UnspecifiedTransactionContext oldContext = (UnspecifiedTransactionContext) ctx;
        GeronimoTransactionContext transactionContext = new GeronimoTransactionContext(
            this,
            (ExtendedTransactionManager) transactionContextManager.getTransactionManager(),
View Full Code Here

   public void begin() throws NotSupportedException, SystemException
   {
      Transaction currentTx;
      if ((currentTx = getTransaction()) != null)
      {
         throw new NotSupportedException(Thread.currentThread() +
               " is already associated with a transaction (" + currentTx + ")");
      }
      AsyncRollbackTransaction tx = new AsyncRollbackTransaction(this, timeout);
      setTransaction(tx);
      txMap.put(tx.generateTransactionId(), tx);
View Full Code Here

    MockControl utControl = MockControl.createControl(UserTransaction.class);
    UserTransaction ut = (UserTransaction) utControl.getMock();
    ut.getStatus();
    utControl.setReturnValue(Status.STATUS_ACTIVE, 1);
    ut.begin();
    utControl.setThrowable(new NotSupportedException("not supported"));
    utControl.replay();

    try {
      JtaTransactionManager ptm = newJtaTransactionManager(ut);
      TransactionTemplate tt = new TransactionTemplate(ptm);
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

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.