Hi!
I have a POJO, used by a BMT Session Bean, where some blocks of the code needs to be executed in a transaction...
The POJO has no handle to the calling Session Bean and its UserTransaction, so my question is: how should I do to obtain a proper UserTransaction?
Is it safe to use:
UserTransaction userTransaction = (UserTransaction) m_jndiContext.lookup("UserTransaction");
Note: For BMT beans, do not obtain the UserTransaction interface using a JNDI lookup. Doing this violates the EJB specification, and the returned UserTransaction object does not have the hooks the EJB container needs to make important checks.