-
differences between stateless and stateful session beans (4 messages)
- Posted by: anil konduru
- Posted on: March 22 2007 02:45 EDT
How to identify which is preferable stateless or stateful during design time.Threaded Messages (4)
- Re: differences between stateless and stateful session beans by John Smith on March 26 2007 23:40 EDT
- Re: differences between stateless and stateful session beans by Pitt Czapczyk on March 27 2007 10:27 EDT
- shoot down stateful bean by Jacky Zheng on March 29 2007 22:40 EDT
- Think about State & Scalability issues by Tarun Arora on March 30 2007 00:28 EDT
-
Re: differences between stateless and stateful session beans[ Go to top ]
- Posted by: John Smith
- Posted on: March 26 2007 23:40 EDT
- in response to anil konduru
How to identify which is preferable stateless or stateful during design time.
If you need state, go for stateful, if not, stateless -
Re: differences between stateless and stateful session beans[ Go to top ]
- Posted by: Pitt Czapczyk
- Posted on: March 27 2007 10:27 EDT
- in response to anil konduru
Hi The difference is in maintenance of a state. When you use stateless session bean there is no state maintained during bean executions in opposition to the stateful session bean when the state is maintained during executions. If you have a requirement about the transaction that should span over two or more bean executions you should use statful session bean, otherwise use stateless session bean with the transaction that spans over the one execution of a bean. -
shoot down stateful bean[ Go to top ]
- Posted by: Jacky Zheng
- Posted on: March 29 2007 22:40 EDT
- in response to anil konduru
try your best to do not use stateful except there is a good reason -
Think about State & Scalability issues[ Go to top ]
- Posted by: Tarun Arora
- Posted on: March 30 2007 00:28 EDT
- in response to Jacky Zheng
Before selecting between the two, do think about State & Scalability. Stateful beans would be required when u want to maintain state acroos multiple requests to the EJB. But this can hamper SCALABILITY of your application. Stateless Beans can be seen as processes and used as Session Facades. This will help you to make your application more scalable as application servers maintain a pool of Stateless session beans to service client requests. But this will not provide you mechanism to maintain state which you can actually maintain in HttpSession if ur working on a webapp. So think about these two issues before selecting of the two and also luk for more issues & let us know about your findings in this thread. Thanks! Tarun