5 Replies Latest reply on Apr 11, 2011 11:46 AM by Benoit Heinrich

    Transaction problems, possible bug in ApplicationExceptionComponentMetaDataLoaderFactory

    Benoit Heinrich Newbie

      Hi All,

       

       

      I think I've found a possible bug with transaction attributes management in jboss 6.0.0 Final.

       

      The problem appears when using the @TransactionAttribute annotation on an EJB bean with the @Interceptors.

       

      When using that it seems that the @TransactionAttribute annotation is ignored.

       

      By removing the @Interceptors annotation it works and the right transaction attribute is used.

       

      After doing some debugging, I think I've finally found the problem in jboss-ejb3-transactions module in the ApplicationExceptionComponentMetaDataLoaderFactory class.

       

      I think the bug is around the createComponentMetaDataRetrieval() method where it searches for the ApplicationExceptionMetaData appExMetaData, but then it checks if the metaData exists instead of checking for the appExMetaData.

       

         public MetaDataRetrieval createComponentMetaDataRetrieval(JBossEnterpriseBeanMetaData metaData, Signature signature,
               ScopeKey key, ClassLoader classLoader)
         {
            if(signature instanceof ClassSignature)
            {
               ApplicationExceptionMetaData appExMetaData = findApplicationException(metaData, signature.getName());
               if(metaData != null)
                  return new BridgedMetaDataLoader<ApplicationExceptionMetaData>(key, appExMetaData, classLoader, defaultBridges);
            }
            return null;
         }
      
      

       

      So then, as the metaData here is always no-null, it then always fallback to a this MetaDataRetrieval instance which in the end doesn't read the TransactionAttribute properly and so, ignores the attribute type.

       

      I'm wondering what other impacts this could have.

       

      If someone can verify that this is the actual problem, I'll be happy to test the bug fix.

      Meanwhile I'll get latest from svn and make the change locally and try it.  So I can also confirm that it works.

       

      btw - I've not been able to reproduce with a simple test case and this is happening in a very large project that I can't easily extract the code from.

      fyi - I'm using jboss-seam 2.2.1.Final in this project, and I'm wondering if this can also be a lead for reproducing that problem.

       

       

      Let me know if I should open a Jira for that.

       

      Cheers,

      /Benoit