Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt about state of Stateless Session Bean  RSS feed

 
Haroldo Nascimento
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have any doubt about Stateless Session Bean:
This type of EJB prove generic services and can cached state ?
This EJB keep a conversation state behalf of several clients ?
I thanks the help me.
Haroldo
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This EJB keep a conversation state behalf of several clients ?

No it doesn't.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A stateless session bean's interface provides methods of which result is not dependent on who the caller is. Thus, they are suitable for "generic services".
Stateless session beans can be used for caching data and maintaining state for multiple clients but that is an area where you'd usually like to stay away from. The catch is that there are no guarantees regarding which bean instance serves which request and the multiple-JVM possibility makes your life even harder if you're trying to use static fields for storing the data. Eventually, you'd have to store the data into a database (not really caching anymore, is it...) or switch to using an entity bean for the clients' state.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!