Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-8459

@TransactionAttribute should not be inherited per EJB 3.2 spec

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 11.0.0.Beta1
    • None
    • EJB
    • None
    • Hide

      Build and deploy attached test case into EAP 7.0x

      mvn clean package wildly:deploy
      

      then in a web browser enter URL

      http://localhost:8080/my-ejb-test-case-web/WebClient

      The server log file should show

      16:10:12,840 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location /Volumes/RedHat/Applications/JBoss-Apps/eap-7/current/jboss-as/standalone-play/data/content/0f/ded0080a911ca83d5518b3a103038c342f52fe/content
      16:10:26,099 WARN  [org.jboss.gss.tomr.testcase.Base] (default task-7) [ABean] bar method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      16:10:26,100 WARN  [org.jboss.gss.tomr.testcase.ABean] (default task-7) [ABean] foo method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      16:10:26,100 WARN  [org.jboss.gss.tomr.testcase.Base] (default task-7) [BBean] bar method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      16:10:26,101 INFO  [org.jboss.gss.tomr.testcase.BBean] (default task-7) [BBean] foo method called - tx UID [0:ffffc0a80164:-c057efb:58da7c9f:14] tx status - 'ACTIVE'.
      16:10:26,101 WARN  [org.jboss.gss.tomr.testcase.CBean] (default task-7) [CBean] There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      16:10:26,102 WARN  [org.jboss.gss.tomr.testcase.CBean] (default task-7) [CBean] There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      16:10:26,102 WARN  [org.jboss.gss.tomr.testcase.DBean] (default task-7) [DBean] There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      16:10:26,102 WARN  [org.jboss.gss.tomr.testcase.Base] (default task-7) [DBean] foo method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      16:10:26,103 WARN  [org.jboss.gss.tomr.testcase.Base] (default task-7) [EBean] bar method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      16:10:26,103 WARN  [org.jboss.gss.tomr.testcase.Base] (default task-7) [EBean] foo method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'.
      
      Show
      Build and deploy attached test case into EAP 7.0x mvn clean package wildly:deploy then in a web browser enter URL http://localhost:8080/my-ejb-test-case-web/WebClient The server log file should show 16:10:12,840 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location /Volumes/RedHat/Applications/JBoss-Apps/eap-7/current/jboss-as/standalone-play/data/content/0f/ded0080a911ca83d5518b3a103038c342f52fe/content 16:10:26,099 WARN [org.jboss.gss.tomr.testcase.Base] (default task-7) [ABean] bar method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'. 16:10:26,100 WARN [org.jboss.gss.tomr.testcase.ABean] (default task-7) [ABean] foo method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'. 16:10:26,100 WARN [org.jboss.gss.tomr.testcase.Base] (default task-7) [BBean] bar method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'. 16:10:26,101 INFO [org.jboss.gss.tomr.testcase.BBean] (default task-7) [BBean] foo method called - tx UID [0:ffffc0a80164:-c057efb:58da7c9f:14] tx status - 'ACTIVE'. 16:10:26,101 WARN [org.jboss.gss.tomr.testcase.CBean] (default task-7) [CBean] There is no active transaction - current transaction status is - 'NO TRANSACTION'. 16:10:26,102 WARN [org.jboss.gss.tomr.testcase.CBean] (default task-7) [CBean] There is no active transaction - current transaction status is - 'NO TRANSACTION'. 16:10:26,102 WARN [org.jboss.gss.tomr.testcase.DBean] (default task-7) [DBean] There is no active transaction - current transaction status is - 'NO TRANSACTION'. 16:10:26,102 WARN [org.jboss.gss.tomr.testcase.Base] (default task-7) [DBean] foo method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'. 16:10:26,103 WARN [org.jboss.gss.tomr.testcase.Base] (default task-7) [EBean] bar method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'. 16:10:26,103 WARN [org.jboss.gss.tomr.testcase.Base] (default task-7) [EBean] foo method called - There is no active transaction - current transaction status is - 'NO TRANSACTION'.

    Description

      It appears that JBoss EAP behaves as the @TransactionAttribute attribute was inherited.

      For example if I have a bean A that

      @Stateless
      @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
      public class ABean extends Base{
        
      
         public void foo(){ . . .}
      }
      

      and a supper class

      @TransactionAttribute(TransactionAttributeType.SUPPORTS)
      public class Base {
       
      
         @TransactionAttribute(TransactionAttributeType.NEVER)
         public void foo(){ . . }
         public void bar(){ . . .}
      }
      

      and if I call each method

      beanA.bar();
      beanA.foo();
      

      I would expect to see bar() without an active transaction and foo() with an active transaction
      but what I see is that both method have no active transaction. This seems like spec violation since the @TransactionAttribute are not supposed to be inherited.

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              sdouglas1@redhat.com Stuart Douglas
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: