0 Replies Latest reply on Dec 23, 2009 12:36 PM by larshuber

    Transactional(TransactionPropagationType.NEVER) -> should fail???

    larshuber

      When marking a method whith TransactionPropacationType NEVER I would expect an exception. This exception is thrown but catched in the TransactionInterceptors Work{...}.




            try {
                transaction = Transaction.instance();
            
                transactionActive =  transaction.isActiveOrMarkedRollback()
                    || transaction.isRolledBack(); //TODO: temp workaround, what should we really do in this case??
                newTransactionRequired = isNewTransactionRequired(transactionActive);          
                userTransaction = newTransactionRequired ? transaction : null;
            } catch (IllegalStateException e) {
               // for shutdown case, when we can't get the tx object because the event context is gone
               // but we should still check if a tx is required and fail accordingly if it is
               newTransactionRequired = isNewTransactionRequired(false);
               if (newTransactionRequired) {
                  throw e;
               }
            }



      I understand this Type to ensure that the method is never called with an active transaction. But with the current TransactionInterception implementation (2.2.1 SNAPSHOT) the Type NEVER has absolutely no effect.


      Do I understand something wrong?


      Thanks for clarification


      Lars