• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stateful/Stateless session beans  RSS feed

 
Raju Vemula
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm a beginner in EJB. Can some one tell me how does a stateful session bean stores it's state and why the stateless session bean doesnot even though it has ejbActivate() and ejbPassivate() methods?

It would be of nice help if you could provide me with some useful links of basics of ejb.

Thanks in advance.

Raju Vemula.
 
Brian Tinnel
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A state of a stateful session bean is persisted by serializing it. From that point, it is up to the app server what it does with the data. For example, it could be stored in a file, or in a database.

Stateless session beans have ejbActivate and ejbPassivate, but those methods are never called. Also, from one call to another you are not guaranteed to be sent to the same instance of a stateless bean

Look around the Java Ranch site for tutorials and stuff for learning EJB. You could also download the EJB spec from here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!