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

@TransactionAttribute should not be inherited per EJB 3.2 spec

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 11.0.0.Beta1
    • Component/s: EJB
    • Labels:
      None
    • Environment:

      JBoss EA P7.0.x

    • Steps to Reproduce:
      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'.
    • Bugzilla Update:
      Perform

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  swd847 Stuart Douglas
                  Reporter:
                  swd847 Stuart Douglas
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: