This content has been marked as final.
Show 1 reply
-
1. Re: Extended persistence and PostConstruct
andrewwheeler Oct 21, 2010 9:34 PM (in response to andrewwheeler)Well just as I thought. It appears there is no context established before the PostConstruct is invoked. From the code in ExtendedEntityManager the beanContext must be null.
public EntityManager getPersistenceContext() { StatefulBeanContext beanContext = StatefulBeanContext.currentBean.get(); EntityManager persistenceContext = beanContext.getExtendedPersistenceContext(identity); if (persistenceContext == null) throw new RuntimeException("Unable to determine persistenceContext: " + identity + " in injected SFSB: " + beanContext.getContainer().getObjectName()); return persistenceContext; }
This may have been around for a while, see https://jira.jboss.org/browse/EJBTHREE-912. I guess I'll just work around it for the moment.