views:

25

answers:

1

I'm adding a RESTful API to an existing application (JBoss 4, EJB 2, adding RESTEasy). The application currently has Session beans with container-managed transactions. To start with, I'm calling remote interfaces on the Enterprise Beans. The EJB usage is being phased out, so new functionality will be added without writing new methods on the beans.

Does JAX-RS or JBoss 4 offer any transaction support on the resource methods? Or do I have to write my own transaction code in each of the resource methods?

JAX-RS has PreProcessInterceptors and PostProcessInterceptors, but does not appear to have an interceptor that wraps an invocation.

A: 

Why don't you use the session beans as your JAX-RS service? Having container managed transactions works very well with Java EE.

For an example see:

Blaise Doughan
The example uses EJB 3. Does it work in EJB 2 as well?
Mark Lutton