Transactional Interceptors in Java EE 7 - Request for feedback
- by arungupta
Linda described how EJB's container-managed transactions can be applied to the Java EE 7 platform as a whole using a solution based on CDI interceptors. This can then be used by other Java EE components as well, such as Managed Beans.
The plan is to add an annotation and standardized values in the javax.transaction package. For example:
@Inherited
@InterceptorBinding
@Target({TYPE, METHOD})
@Retention(RUNTIME)
public @interface Transactional {
TxType value() default TxType.REQUIRED
}
And then this can be specified on a class or a method of a class as:
public class ShoppingCart {
...
@Transactional
public void checkOut() {...}
...
}
This interceptor will be defined as part of the update to Java Transactions API spec at jta-spec.java.net.
The Java EE 7 Expert Group needs your help and looking for feedback on the exact semantics. The complete discussion can be read here. Please post your feedback to [email protected] and we'll also consider comments posted to this entry.