users@ejb-spec.java.net

[ejb-spec users] [jsr345-experts] Re: Pushing _at_Transactional in the EJB spec ?

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Mon, 04 Mar 2013 20:44:00 -0800

It's noted in the JTA spec and somewhat in the Interceptors spec already
and I planned to add a word of caution on the Tx interceptors to the EJB
spec. The problem with these interceptors is that they are CDI
interceptors and as such are invoked after the @Interceptors interceptor
and may change tx context if they are not the same as the EJB settings.

-marina

On 3/4/13 7:57 AM, Antonio Goncalves wrote:
> I was reading the JTA JIRAs about the Transactional model in Managed
> Beans (http://java.net/jira/browse/JTA_SPEC-5). It will be using the
> new interceptor binding @javax.transaction.Transactional with a
> TrxType (REQUIRED, REQUIRES_NEW...) :
>
> @Inherited
> @InterceptorBinding
> @Target({TYPE,METHOD})
> @Retention(RUNTIME)
> public @interface *Transactional *{ TxType value() default
> TxType.REQUIRED }
>
> public enum *TxType *{ REQUIRED, REQUIRES_NEW, MANDATORY, SUPPORTS,
> NOT_SUPPORTED, NEVER }
>
>
> There is nothing about @Transactional in the EJB spec. Why don't we
> push the new @Transactional model into EJBs ? This way developers
> would be encouraged to use @Transactional all over the plateform and
> start forgetting about javax.ejb.TransactionAttribute.
>
> What do you think ?
>
>
> --
> Antonio Goncalves
> Software architect and Java Champion
>
> Web site <http://www.antoniogoncalves.org> | Twitter
> <http://twitter.com/agoncal> | LinkedIn
> <http://www.linkedin.com/in/agoncal> | Paris JUG
> <http://www.parisjug.org> | Devoxx France <http://www.devoxx.fr>