[jboss-user] [EJB3] - Transaction problems, possible bug in ApplicationExceptionComponentMetaDataLoaderFactory

Benoit Heinrich do-not-reply at jboss.com
Mon Apr 11 06:15:00 EDT 2011


Benoit Heinrich [http://community.jboss.org/people/benoit.heinrich] created the discussion

"Transaction problems, possible bug in ApplicationExceptionComponentMetaDataLoaderFactory"

To view the discussion, visit: http://community.jboss.org/message/599161#599161

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/599161#599161]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110411/f1c36dff/attachment.html 


More information about the jboss-user mailing list