Package javax.transaction

Examples of javax.transaction.NotSupportedException


      if (current != null)
      {
         if (current.isDone())
            disassociateThread(ti);
         else
            throw new NotSupportedException
                  ("Transaction already active, cannot nest transactions.");
      }

      long timeout = (ti.timeout == 0) ? timeOut : ti.timeout;
      TransactionImpl tx = new TransactionImpl(timeout);
View Full Code Here


    {
        Thread thread = Thread.currentThread();
        ReadOnlyTransactionImpl tx = txThreadMap.get( thread );
        if ( tx != null )
        {
            throw new NotSupportedException(
                "Nested transactions not supported" );
        }
        tx = new ReadOnlyTransactionImpl( this );
        txThreadMap.put( thread, tx );
    }
View Full Code Here

        Thread thread = Thread.currentThread();
        TransactionImpl tx = txThreadMap.get( thread );
        if ( tx != null )
        {
            throw new NotSupportedException(
                "Nested transactions not supported" );
        }
        tx = new TransactionImpl( this );
        txThreadMap.put( thread, tx );
        int concurrentTxCount = txThreadMap.size();
View Full Code Here

    }

    public TransactionContext newBeanTransactionContext(long transactionTimeoutMilliseconds) throws NotSupportedException, SystemException {
        TransactionContext ctx = getContext();
        if (ctx instanceof UnspecifiedTransactionContext == false) {
            throw new NotSupportedException("Previous Transaction has not been committed");
        }
        UnspecifiedTransactionContext oldContext = (UnspecifiedTransactionContext) ctx;
        BeanTransactionContext transactionContext = new BeanTransactionContext(transactionManager, oldContext);
        oldContext.suspend();
        try {
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));
        threadTx.set(tx);
                // Todo: Verify if this is correct thing to do. Use default timeout for next transaction.
View Full Code Here

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

      throw new NotSupportedException(
          L.l("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 {0}.",
              xaState(status)));
    }
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

  @Override
  public void begin()
    throws NotSupportedException, SystemException
  {
    if (_isTransactionActive)
      throw new NotSupportedException(L.l("UserTransaction.begin() is not allowed because an active transaction already exists.  This may be caused by either a missing commit/rollback or a nested begin().  Nested transactions are not supported."));
   
    _transactionManager.begin();
    _isTransactionActive = true;
    boolean isOkay = false;
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.