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.
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;
@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.
Thank you so much for your very detailed explanation.