2 Replies Latest reply on Jun 8, 2009 7:18 AM by jaikiran

    EJBTHREE-1844: Retry on rollback

    wolfc

      I've added a function to retry an operation whenever an EJBTransactionRolledbackException occurs. Usually this is because of a resource commit failure, which could be caused by a temporary problem (dead lock / outage).

      To configure the retry currently the annotation org.jboss.ejb3.tx.api.TransactionRetry needs to be put either on the bean or on a method.

      What I don't like is the fact that the annotation now resides within ejb3-transactions, so I've marked it experimental. Either it should go to ejb3-ext-api, but this would change our api (for the better) or into ejb3-tx-api. Alternatively I could create an ejb3-tx-retry component which would could slot into a runtime.

      Also we need to be able to extend jboss-metadata to allow plugins, so that the retry function can be enabled via descriptors.

      How do we want to proceed here?

        • 1. Re: EJBTHREE-1844: Retry on rollback
          jaikiran

          IMO, there should be a common location for all the jboss specific annotations. Hence i think the ejb3-ext-api is the right place for this.

          Also we need to be able to extend jboss-metadata to allow plugins, so that the retry function can be enabled via descriptors.


          I am not really good at xml xsd and similar things, but i guess there would be some option available where in we can say a given xsd element (ex: sessionBeanType) can have multiple different type of sub-elements whose type is not known. Just an example in jboss.xml

          <session>
           <tx-retry>numberofattempts</tx-retry>
           ...// later on for some other functionality
           <xyz>blahblahblah</xyz>
          </session>


          • 2. Re: EJBTHREE-1844: Retry on rollback
            jaikiran

             

            "jaikiran" wrote:
            can have multiple different type of sub-elements whose type is not known.


            Or maybe the type of the sub-elements can be a common JBoss specific interface which the new elements implement.