Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stateful beans

 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys

If you compare advantages v/s disadvantages of stateful session bean in J2EE, would you use it?

disadvantages:
no bean pooling.
require more memory and system resources to store state.
scalability problem
ect

advantages:
activation/passivation feature,
maintaining state.

i feel the disadvantages outpowers the advantages.

and that might be the reason why people dont usally go for stateful session bean.

Do you know of any scenario where you would use stateful session bean(over stateless session beans) and justify why you did so.

thanks
[ January 03, 2007: Message edited by: jay roy ]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In developing J2EE applications, there are no right answers, there are only wrong answers. The best we can do is not get a wrong answer.

Stateful Session Beans (SFSBs) certainly get a bad wrap, especially due to the lack of clustering capabilities that makes people worry about scaling (WebSpehre 6 can cluster them though!).

For managing state of web based applications, the HttpSession is definitely preferable, but for standalone applications that are not HTML based, using a stateful session bean may actually be one of the 'not wrong' answers.

-Cameron McKenzie
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes , very well said Cameron
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic