Hello JJ and Pete,
As you know we have two new JTA annotations (Transactional and TransactionScoped) in JTA1.2 that provide support in CDI.
The current JTA 1.2 spec/MR describing these can be found here:
http://java.net/projects/jta-spec/sources/spec-source-repository/content/JTA1.2Specification.pdf?rev=6
Could I ask your help to resolve/clarify Ian's question below?
Thanks,
Paul
On Mar 14, 2013, at 2:43 PM, Ian Robinson wrote:
>
> - I believe we need to additionally clarify a potential conflict between JTA and CDI: servlets, JAX-RS resource classes, and JAX-WS service endpoints are created by their containers with non-contextual references (according to the platform specification EE 5.24 and in our implementation) but the CDI spec (section 7.2) precludes bean with non-contextual references from being intercepted:
>
> 7.2. Container invocations and interception
> When the application invokes:
> • a method of a bean via a contextual reference to the bean, as defined in Section 6.5.3, “Contextual reference for a
> bean”, or
> • a business method of a session bean via an EJB remote or local reference,
> the invocation is treated as a business method invocation.
>
> --snip--
>
> If, and only if, an invocation is a business method invocation:
> • it passes through method interceptors and decorators, and
> • in the case of a session bean, it is subject to EJB services such as declarative transaction management, concurrency, se-
> curity and asynchronicity, as defined by the EJB specification.
> Otherwise, the invocation is treated as a normal Java method call and is not intercepted by the container.
>
>
> It seems like CDI 7.2 needs to extend the scope of "business method of a session bean via an EJB remote or local reference" to include @Transactional beans with non-contextual references. Can you confirm whether this interpretation is correct and, if so, how the CDI spec could be changed to be consistent?