Package javax.transaction

Examples of javax.transaction.NotSupportedException


    */
   public void begin() throws NotSupportedException, SystemException
   {
      if (getCurrentTransaction() != null)
      {
         throw new NotSupportedException("Attempt to start a nested transaction");
      }

      GenericTransaction tx = new GenericTransaction();

      setCurrentTransaction(tx);
View Full Code Here


   public void begin() throws NotSupportedException, SystemException
   {
      if (TransactionSynchronizationManager.isActualTransactionActive())
      {
         throw new NotSupportedException("A Spring transaction is already active.");
      }
      currentTransaction = platformTransactionManager.getValue().getTransaction(definition);
   }
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

   private void assertNotActive() throws NotSupportedException
   {
      if ( isEntityManagerSet() )
      {
         throw new NotSupportedException("transaction is already active");
      }
   }
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 + ")");
      DummyTransaction tx = new DummyTransaction(this);
      setTransaction(tx);
   }
View Full Code Here

/*     */       {
/*  75 */         checkTransactionState();
/*     */       }
/*     */       catch (IllegalStateException e1)
/*     */       {
/*  79 */         throw new NotSupportedException(e1.getMessage());
/*     */       }
/*     */       catch (Exception e2)
/*     */       {
/*  83 */         throw new SystemException(e2.toString());
/*     */       }
View Full Code Here

/*     */     {
/* 257 */       checkTransactionState();
/*     */     }
/*     */     catch (IllegalStateException e1)
/*     */     {
/* 261 */       throw new NotSupportedException();
/*     */     }
/*     */     catch (Exception e2)
/*     */     {
/* 265 */       throw new SystemException(e2.toString());
/*     */     }
View Full Code Here

            case Status.STATUS_ROLLEDBACK:
            case Status.STATUS_UNKNOWN:
               setTransaction(null);
               break;
            default:
               throw new NotSupportedException(Thread.currentThread() +
                 " is already associated with a transaction (" + currentTx + ")");
         }

      }
      AsyncRollbackTransaction tx = new AsyncRollbackTransaction(this, timeout);
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

  }

  public void testJtaTransactionManagerWithNotSupportedExceptionOnNestedBegin() throws Exception {
    UserTransaction ut = mock(UserTransaction.class);
    given(ut.getStatus()).willReturn(Status.STATUS_ACTIVE);
    willThrow(new NotSupportedException("not supported")).given(ut).begin();

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