4 Replies Latest reply on Apr 19, 2010 8:23 PM by pmuir

    Seam-persistence: @javax.ejb.TransactionAttribute

    adamw

      The persistence module page contains a proposition to create a javax.ejb.TransactionAttributeType enum equivalent for Seam.


      I think that creating an equivalent is generally a good idea, as it always gives greater flexibility and makes it possible for non-JEE applications to use the transaction management without bundling the JEE APIs. So +1 here.


      However, renaming some of the types (e.g. ISOLATED instead of REQUIRES_NEW) is in my opinion a bad idea. JEE users are used to the current names, so why change them? And new users will only have to become familiar with one set of names. I don't think the current names are bad enough to justify a renaming. -1 here.


      What about the NEST type? Is it currently supported by Arjuna, or some other jta implementations?


      Adam


        • 1. Re: Seam-persistence: @javax.ejb.TransactionAttribute
          swd847

          I agree that the renames are a bad idea, I think creating multiple names will only cause confusion.


          I think it would also be good to allow the user of the @TransactionAttribute annotation though, as there have been lots of forum posts where users have been confused with which annotations only work on EJB's and which ones work on all seam components.


          • 2. Re: Seam-persistence: @javax.ejb.TransactionAttribute
            adamw

            Hmm, but that's all typesafe, so once you use the @TransactionAttribute annotation you know which type to use as the element. And creating two annotation elements for both enumerations may be even more confusing imho.


            Adam

            • 3. Re: Seam-persistence: @javax.ejb.TransactionAttribute
              asookazian

              I recall commenting about this to the Seam dev team recently.  Changing the names is a bad idea (e.g. ISOLATED instead of REQUIRES_NEW).


              This is one of the reasons it would be nice if there was a smart @TransAttributeType annotation that would allow the dev to select the appropriate enum constant for the appropriate context (i.e. in Java EE 5, REQUIRES_NEW is available for session bean but not available for Seam 2.x JavaBean component).  That way you could use the same annotation for both EJB3 and JavaBeans and not worry about remembering which annotation to use for which kind of component.  I have a feeling this is not technically possible with annotations.


              So we're stuck with using Seam's @Transactional and EJB 3's @TransactionAttribute...

              • 4. Re: Seam-persistence: @javax.ejb.TransactionAttribute
                pmuir

                Yes, we shouldn't change the names of the attributes.