users@glassfish.java.net

Re: Transaction problem when persisting Entity class

From: <glassfish_at_javadesktop.org>
Date: Mon, 19 Oct 2009 20:17:20 PDT

>> If B has a container-managed PersistenceContext, why do you get an exception
that mentions an EntityTransaction?

I don't know.

>> The transaction is started in onMessage in your bean A, so it'll be finished
when this method returns (unless you mark the method in bean B as
TransactionAttributeType.REQUIRES_NEW). Until the data is committed, it can't be
accessed by another transaction.

onMessage isn't being called at this point. I have a servlet that gets deployed with the enterprise app. It's job is to call the initialize method of class A when the app is deployed. When that occurs, a timer is created. When the timer is ready, it calls ejbTimout. Currently, no message is sent to A. The only thing that occurs is A's ejbTimeout is called and this causes a call to B's Local interface method.

There is an exception being thrown when a persist call is made as a result of the call to B's Local method.
[Message sent by forum member 'darryl_m' (darryl.mocek_at_sun.com)]

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