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

BuiltInBeansTest.testUserTransactionBean()

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Done
    • 1.0.4.Final
    • 1.0.5.CR1, 1.1.0.Alpha2
    • 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)
            Archiver:
            rhn-support-abdwived Abhishek Dwivedi (Inactive)

            Dates

              Created:
              Updated:
              Resolved:
              Archived: