afterCompletion() has a clent security context . So , eventhough it doesnt have a transaction context , it should be able to accesss resource mgr and beans . but the specification(on pg 80) says not so!! please check this
There is no meaningful transaction context, hence no access to a resource manager. Resource managers always have a transaction context of some sort. Spec page 81.
Reid - SCJP2 (April 2002)
posted 16 years ago
Infact page 81 of the spec says that "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 ex , even ejbCreate() , ejbRemove(),ejbActivate() and ejbPassivate() methods of SFSB will be in unspecified transactional context . But they can access resource mgrs and other Enterprise beans because they have a security context attached with them . Its the same case with afterCompletion . ie.Though this doesnt have a transactional context , it has a security context (for ex , it can call getCallerPrincipal and isCallerInRole(String roleName)) . But i do not really understand why this afterCompletion(boolean isCommitted) can not access resource mgrs and other beans while ejbCreate() etc can access ...Please Clarify .
This one time, at bandcamp, I had relations with a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!