}
private PhysicalEntityManagerWrapper findExtendedEMFromInvList(EntityManagerFactory emf) {
PhysicalEntityManagerWrapper em = null;
ComponentInvocation compInv = (ComponentInvocation)
invocationManager.getCurrentInvocation();
if (compInv != null) {
if (compInv.getInvocationType() == ComponentInvocation.ComponentInvocationType.EJB_INVOCATION) {
EjbInvocation ejbInv = (EjbInvocation) compInv;
if (ejbInv.context instanceof SessionContextImpl) {
SessionContextImpl ctxImpl = (SessionContextImpl) ejbInv.context;
if (ctxImpl.container instanceof StatefulSessionContainer) {
em = ctxImpl.getExtendedEntityManager(emf);