-
1. Re: lazy loading exception
blabno Dec 29, 2009 12:45 PM (in response to aymenez)If you are not using seam managed persistent context then no way. You always can load assotiations in your stateless bean.
-
2. Re: lazy loading exception
aymenez Dec 29, 2009 12:51 PM (in response to aymenez)Hello,
what do you mean by seam managed persistent context? you mean that i must not use the persistent Context injected by JBOSSAS, you mean i use POJO and not EJBs?I am sorry, I do not undersand
You always can load assotiations in your stateless bean
, how? -
3. Re: lazy loading exception
blabno Dec 29, 2009 1:13 PM (in response to aymenez)Standard EJB have @PersistenceContext annotation which injects EntityManager from application server. Seam creates it's own EntityManager and can inject it for you via @In annotation. To use SMPC you must setup in in components.xml. It is described in reference manual. If you have configured it as
entityMasta
then in your code :@In EntityManager entityMasta;
Loading lazy associations : iterate over collection holding that association.