users@glassfish.java.net

Re: question about JPA and container-managed transaction (Att=REQUIRED_NEW)

From: <glassfish_at_javadesktop.org>
Date: Fri, 01 Jun 2007 11:09:08 PDT

The easiest thing to do is to pull the REQUIRE_NEW methods out in to a seperate Session Bean, and then call them through the Session Bean.

As was mentioned earlier, once you're "in" the Session Bean, all of the other calls are essentially local method calls and do not go through the EJB demarcation line.

But when you make calls across from seperate EJBs, those calls ARE demarcated properly.

Also be careful that you don't have cycles in your beans.

For example, BeanA calls BeanB which calls BeanA. This will lead to trouble as Session Beans are not re-entrant. You will most likely get an exception when BeanB tries to call back in to BeanA.
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=220061