Uploaded image for project: 'CDI TCK'
  1. CDI TCK
  2. CDITCK-220

BuiltInBeansTest.testUserTransactionBean()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.0.5.CR1, 1.1.0.Alpha2
    • 1.0.4.Final
    • Tests
    • None

    Description

      We're passing this test, but wanted to drop a note that it should be updated. We just need to update this bean like so:

      @Stateful
      @TransactionManagement(BEAN)
      public class UserTransactionInjectedBean implements UserTransactionInjectedBeanLocal
      {
      
         @Inject transient UserTransaction userTransaction;
         
         public UserTransaction getUserTransaction()
         {
            return userTransaction;
         }
      
      }
      

      Only @Stateful session bean explicitly marked as @TransactionManagement(BEAN) are allowed to get UserTransaction via lookup or injection, the EJB TCK tests cover this pretty well. In OpenEJB we have deploy-time checks for this if @Resource is used to get a UserTransaction and we'd like to expand that checking to properly cover @Inject injection as well. Even though we are currently injecting that object and passing the test, it's a "false" pass and at runtime that UserTransaction object is hardwired to throw exceptions if used by a non-CMT bean.

      Attachments

        Activity

          People

            mkouba@redhat.com Martin Kouba
            dblevins_jira David Blevins (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty