• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sessions

 
Bala covai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you will chose Stateful session bean and Stateless session bean?
 
Bala covai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateful session beans are used when there is converstional state and when there is a need of temporary storage Stateless session bean are used when there is no conversational state and when session bean has to be used only for database.
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bala covai:
... and when session bean has to be used only for database.


What do you mean by this ?



Both beans can access database.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bala,
There is an EJB forum on this site where you will probably find more people who can help with such questions.
This forum is for Servlets.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the EJB forum as requested.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bala,


When you will chose Stateful session bean and Stateless session bean?

In theory SFSBs can maintain state for every client, while SLSBs don�t, etc, etc. I�m not going to bore you with details that you can find in every EJB book.
In practice though the answer is quite different and sounds very simple: stay away from SFSBs as much as you can. One very important treason is that SFSBs don�t scale very well though. Another good reason is that using HttpSession is more efficient solution and you might achieve the same goals. However, there are situation when SFSBs are required and a good example is when developing an application that has rmi clients as well (and you cannot make use of HttpSession).
Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic