Regarding beanness in case of 'afterCompletion' method
In EJB 2.0 Spec Pg 81, it is said that
Pt 1:
Invoking the getCallerPrincipal and isCallerInRole methods is disallowed in the session bean methods for which the Container does not have a client security context.
Pt 2:
"Accessing resource managers and enterprise beans is disallowed in the session bean methods for which the Container does not have a meaningful transaction context or client security context."
For afterCompletion method spec says we can call isCallerInRole so that means it has Security Context, then why is it not allowed to access Resource Managers or other beans according to Pt 2?
# 1
You're right to point out this inconsistency. It doesn't make any sense for isCallerInRole and
getCallerPrincipal to be callable in afterCompletion, since the callback itself is not tied to a client
invocation.This was probably an oversight made in the first spec that was not removed merely
to preserve backward compatibility.
ksaksa at 2007-7-12 20:56:50 >

# 2
Hi ksaks,
Does it mean if transaction context is available, then only we can access a resource manager or any other beans?
If above is the case, eventhough there is no transaction context, we are still able to access other beans as part of callback methods like "ejbActivate" or "ejbPassivate" of statefull session bean.
or the specification itself did not clearly differentiated between with BMT & CMT
Sorry iam not implementing the code and checking wheather the concept stated is correct or wrong?