users@glassfish.java.net

Re: GFv1b14 Transaction problems

From: <glassfish_at_javadesktop.org>
Date: Thu, 14 Jun 2007 14:56:30 PDT

Reentrancy is never an issue for SLSBs, since each business method invocation
(meaning, a component invocation using an ejb reference) is required to be handled by the
container using a bean instance that is not already involved in an invocation.

Likewise, it's not applicable to SFBs since they are not intended to be shared by multiple
clients at once. If an SFSB is in the middle of a business method invocation and a downstream
call tries to invoke back on the same SFSB identity it will be rejected by the container.

Reentrancy is really only applicable to pre-EJB 3.0 Entity beans. For those components,
the there is a single bean instance for a given primary key within a transaction. If an
instance is in the middle of an invocation and a downstream call accesses the same bean/PK,
it might involve a loopback call on the same bean instance. The developer can choose whether this should be allowed or not via metadata.

Your example isn't allowed by the spec. Bean instances must never pass "this" around.
Only the container has direct references to bean instances. All other access from the
application code is made via ejb references. That's what allows the container to do its
magic.

 --ken
[Message sent by forum member 'ksak' (ksak)]

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