Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-3503

NPE when using @Singleton @Transactional(TxType.REQUIRES_NEW)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.12.1.Final
    • None
    • None
    • None
    • Hide

      Deploy the following exemple in WF24.0.0.Final :

      @Startup @Singleton @ConcurrencyManagement(ConcurrencyManagementType.BEAN)
      public class A {
      
          @Inject
          private B b;
      
          @PostConstruct
          void initialize() {
              b.performInNewTransaction();
          }
      }
      
      @Singleton @ConcurrencyManagement(ConcurrencyManagementType.BEAN)
      public class B {
      
          @Transactional(TxType.REQUIRES_NEW)
          public void performInNewTransaction() {
          }
      }
      

      Not sure if this can be any help, but I've noticed there's no issue when using @TransactionAttribute instead of @Transactional such as:

      @Singleton @ConcurrencyManagement(ConcurrencyManagementType.BEAN)
      public class B {
      
           @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
           public void performInNewTransaction() {
           }
      }
      

      Our use case though require @Transactional

      Show
      Deploy the following exemple in WF24.0.0.Final : @Startup @Singleton @ConcurrencyManagement(ConcurrencyManagementType.BEAN) public class A {     @Inject     private B b;     @PostConstruct     void initialize() {         b.performInNewTransaction();     } } @Singleton @ConcurrencyManagement(ConcurrencyManagementType.BEAN) public class B {     @Transactional(TxType.REQUIRES_NEW)     public void performInNewTransaction() {     } } Not sure if this can be any help, but I've noticed there's no issue when using @TransactionAttribute instead of @Transactional such as: @Singleton @ConcurrencyManagement(ConcurrencyManagementType.BEAN) public class B {     @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)     public void performInNewTransaction() { } } Our use case though require @Transactional
    • Undefined

    Description

      Hi,

      We are upgrading from WF23.0.2.Final (Narayana 5.10.6) to WF24.0.0.Final (Narayana 5.12) and we stumbled on the following NPE

      Caused by: java.lang.NullPointerException
      	at org.jboss.jts//com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorBase.getTransactional(TransactionalInterceptorBase.java:112)
      	at org.jboss.jts//com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:203)
      	at org.jboss.jts//com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorRequiresNew.doIntercept(TransactionalInterceptorRequiresNew.java:54)
      	at org.jboss.jts//com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorBase.intercept(TransactionalInterceptorBase.java:90)
      	at org.jboss.jts//com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorRequiresNew.intercept(TransactionalInterceptorRequiresNew.java:47)

       

      The issue seems somewhat linked to the very recent change in Narayana:

      https://github.com/jbosstm/narayana/commit/ced7cdf7431a051457202b204378e7a1a321281e#diff-bd6a83433b5079cb87b9cad6b099d1d62d6e7a2678849ab9b8973b6ff21cebd7

       

      I've attached a very simple reproducer to this issue. Let me know if I can help in any way.

       

      Thank you!

      Attachments

        Issue Links

          Activity

            People

              rchakrab Ranabir Chakraborty
              rchakrab Ranabir Chakraborty
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: