This content has been marked as final.
Show 4 replies
-
1. Re: @PersistenceContext or @In with EntityManager
sebasfiorent Jun 21, 2006 10:14 AM (in response to sebasfiorent)I think that I've self responded. But someone can confirm to me this:
The rule is:
"If you're a seam component, then you MUST use @In(create=true) EntityManager entityManager"
else
"If you're an EJB3 Bean, you MUST use @PersistenceContext annotation".
Is that correct?
Thanks in advance
Sebastian -
2. Re: @PersistenceContext or @In with EntityManager
gavin.king Jun 21, 2006 10:58 AM (in response to sebasfiorent)Well yes, but you can choose either approach for a session bean Seam component.
-
3. Re: @PersistenceContext or @In with EntityManager
sebasfiorent Jun 28, 2006 10:00 AM (in response to sebasfiorent)"gavin.king@jboss.com" wrote:
Well yes, but you can choose either approach for a session bean Seam component.
Ok, but what happens in the following scenario:
Supose that I'm coding an EJB3 Session Bean with some services. I have an EntityManager annotated with @In annotation.
If my bean get's called from a remote Swing application, the EntityManager get's instantiated and managed correctly? Or it only works when the bean is called from JSF stack?
Regards,
Sebastian -
4. Re: @PersistenceContext or @In with EntityManager
gavin.king Jun 28, 2006 11:54 AM (in response to sebasfiorent)Actually, SeamInterceptor is able to set up a set of contexts even when the Seam component is called via RMI. So it will work.
(Note that this may only be working properly in Seam CVS, I'm not sure, I did some recent fixes.)