aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Sessions" Watch "Sessions" New topic
Author

Sessions

Bala covai
Greenhorn

Joined: Oct 03, 2005
Posts: 2
When you will chose Stateful session bean and Stateless session bean?
Bala covai
Greenhorn

Joined: Oct 03, 2005
Posts: 2
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

Joined: Sep 11, 2005
Posts: 121


keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

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.


Groovy
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Moved to the EJB forum as requested.
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
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.


I think, therefore I exist -- Rene Descartes
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Sessions