users@javaee-spec.java.net

[javaee-spec users] Transactional annotation

From: Christian Beikov <christian.beikov_at_gmail.com>
Date: Fri, 01 Jun 2012 21:12:52 +0200

Hello there!

I wanted to contribute to the discussion on
http://java.net/projects/javaee-spec/lists/jsr342-experts/archive/2012-01/message/35.
IMO the transactional annotations used right now, by most of the users
that implemented the interceptor themselves, will use the D2 approach
and therefore this should be the default! There are a lot of articles
describing how to implement the interceptor with a UserTransaction and
exactly the behavior described in D2.

Generally, I would like to be able to define the exceptions with
RollbackOnException that will cause a rollback as described in an answer
to the original mail. Annotating RollbackOnException should then
override the default behavior of rolling back on any exception and just
roll back on the exceptions declared in the annotation(and of course on
subtypes of the declared ones).

This would be IMO the most intuitive defaults, anyway, people who don't
like how it will be released can just define their own stereotype
annotation, defining their preferred behavior once, and use their own
annotation for the transaction behavior to reduce code duplication.
Especially because of the fact that you can use interceptors on
stereotype annotations, I don't really care if the defaults will be
defined different, as long as it will be configureable :)

-- 
Mit freundlichen Grüßen,
------------------------------------------------------------------------
*Christian Beikov*