This content has been marked as final.
Show 4 replies
-
1. Re: Seam managed entity manager and sessions beans
torsty Jun 3, 2007 5:02 PM (in response to moshe1)Can you post the code of your sfsb?
-
2. Re: Seam managed entity manager and sessions beans
moshe1 Jun 4, 2007 2:17 AM (in response to moshe1)I have tried using @PostContruct and @Create
@Name("importer") @Scope(ScopeType.SESSION) @Stateful public class Importer implements ImporertLocal, Serializable{ private CabinetSelectionModel cabinetSelector; @In(create=true) private EntityManager em; @PostConstruct public void init() { cabinetSelector = new CabinetSelectionModel(em); } }
-
3. Re: Seam managed entity manager and sessions beans
torsty Jun 4, 2007 4:04 AM (in response to moshe1)The componente name of the SMPC is "entityManager" To inject the Seam Entity Manager cou can either:
@In(value="entityManager" ) private EntityManager em;
or you name your variable entityManager, i.e.
@In
private EntityManager entityManager; -
4. Re: Seam managed entity manager and sessions beans
moshe1 Jun 4, 2007 4:41 AM (in response to moshe1)I tried your suggestion and it did not work. I changed my components.xml as well
from<core:managed-persistence-context name="em" auto-create="true" persistence-unit-jndi-name="java:/EntityManagers/pt">
to<core:managed-persistence-context name="entityManager" auto-create="true" persistence-unit-jndi-name="java:/EntityManagers/pt">