Package javax.transaction

Examples of javax.transaction.NotSupportedException


    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


    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

          dumpTransactionContexts();
        }

        BitronixTransaction currentTx = getCurrentTransaction();
        if (currentTx != null)
            throw new NotSupportedException("nested transactions not supported");
        currentTx = createTransaction();

        ThreadContext threadContext = ThreadContext.getThreadContext();
        ClearContextSynchronization clearContextSynchronization = new ClearContextSynchronization(currentTx, threadContext);
        try {
View Full Code Here

        else {

            String tid = getThreadMapping ();
            if ( tid != null ) {
                // error: no nested txs supported
                throw new NotSupportedException (
                        "Nested transaction not allowed here" );
            }

            try {
                tid = txmgrServer_.begin ( timeout_ );
View Full Code Here

          Status.STATUS_MARKED_ROLLBACK, Status.STATUS_ROLLING_BACK, Status.STATUS_UNKNOWN };
     
      // SystemException and NotSupportedException from tm.begin()
      Set<Exception> ees = new HashSet<Exception>();
      ees.add(new SystemException("KABOOM!"));
      ees.add(new NotSupportedException("KABOOM!"));
     
      // Loop through all states states twice changing the exception thrown
      // from tm.begin()
      for (int i = 0 ; i < allStates.length ; i++ ) {
        Iterator<Exception> iterator = ees.iterator();
View Full Code Here

   private void assertNotActive() throws NotSupportedException
   {
      if ( isEntityManagerSet() )
      {
         throw new NotSupportedException("transaction is already active");
      }
   }
View Full Code Here

   private void assertNotActive() throws NotSupportedException
   {
      //TODO: translate exceptions that occur into the correct JTA exception
      if ( isSessionSet() )
      {
         throw new NotSupportedException("transaction is already active");
      }
   }
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

    }

    public BeanTransactionContext newBeanTransactionContext(long transactionTimeoutMilliseconds) 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 transactionContext = new BeanTransactionContext(transactionManager, oldContext);
        oldContext.suspend();
        try {
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.