-
1. Re: Stateful session bean vs. session Context, which one is
pmuir Jun 29, 2006 12:04 PM (in response to gus888)Seam has a number of contexts available (http://docs.jboss.com/seam/1.0.1.GA/reference/en/html/concepts.html#d0e2021).
SFSBs are used for any stateful context, SLSBs are used for a stateless context.
They are all useful in the same project for different things - look at the booking store example, I think it uses the SESSION context, CONVERSATION contexts and stateless contexts. -
2. Re: Stateful session bean vs. session Context, which one is
gus888 Jun 29, 2006 12:17 PM (in response to gus888)Hi there, Thank you very much for your help. I want to whether the two group codes have the same functions, as follows:
@PersistenceContext private EntityManager em;
@In(create=true) private EntityManager entityManager;
Thank you. -
3. Re: Stateful session bean vs. session Context, which one is
pmuir Jun 29, 2006 12:29 PM (in response to gus888)http://docs.jboss.com/seam/1.0.1.GA/reference/en/html/configuration.html#d0e4853
@PeristenceContext/@PersistenceContext(type=EXTENDED) are the EJB3/JPA standard annotations for injecting a PC. @In(create=true) is the Seam way, which, as discussed in the manual, means that LazyInitialisationExceptions don't occur.
In short, you will get an LIE if you try to access an object outside the session (transaction?) in which it is loaded with @PersistenceContext, you won't with @In(create=true). The downside to @In(create=true) is that it is Seam specific so won't work if you access the bean outside Seam.
I'm developing a Seam/JSF only application so nearly always use a Seam Managed PC. -
4. Re: Stateful session bean vs. session Context, which one is
gus888 Jun 29, 2006 12:53 PM (in response to gus888)Thank you so much for your very detailed explanation.