keith wrote:
I don't think it is the case that a method is running in a transaction to access a resource manager. With stateful session beans, resource managers can be accessed in ejbCreate and ejbRemove, although these methods do not run in a transaction.
You're right. Running or not in client's transaction context doesn't imply that we may or not access the ressource manager.
For stateful session beans for example, ejbCreate() runs in a "unspecified Transaction Context", although we may access a database inside.
So why do we found such explanations in HFE, p.512, about afterCompletion() method.
You're no longer in a transaction! You can access ONLY your special JNDI context. It's not safe to access resource managers or other beans.
To put it in a nutshell, why
do we have sometimes to take care if we are in transaction to access databases (afterBegin() or beforeCompletion() ) and somtimes not (for example ejbCreate() or ejbRemove()). It's not very clear to me.
Thanks for your help,
Regards,
Cyril.
[ February 14, 2004: Message edited by: cyril vidal ]
SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287