0

Pascal Thivent mentions here that -

If you are using SFSB, then you must avoid injecting them into classes that are multithreaded in nature, such as Servlets and JSF managed beans (you don't want it to be shared by all clients).

Moving swiftly on, BalusC also put forwards the same thing here-, but indirectly.

....use SFSB only when you want a real stateful session bean

Consider a Session Scoped Managed bean-

@SessionScoped
public class Bean{
     @EJB
     EjbBean ejbBean;
}

with

@Stateful
public class EjbBean{
}

But the above SessionScoped bean will be linked to one client only and as such will have state/ instance variables different from other session scoped bean. Subsequently, any stateful EJB bean will not be shared by other clients.

Please suggest on what the author implies when he says-

you don't want it to be shared by all clients

I do perfectly understand the difference b/w HttpSession & the session word in Stateless Session Bean.

Community
  • 1
  • 1
Farhan stands with Palestine
  • 13,890
  • 13
  • 58
  • 105

0 Answers0