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

Design decision? Only for real Architects...

 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I was wondering what the best solution would be to hold Session information in a J2EE application.
If I develop an application using JSP, Servlet and EJB technology where should I hold all the session information.
In a previous project we chose to hold everyting on the EJB side. Keep the HttpSession as empty as possible. We had one Stateful session bean that holds all session info.
We did this because some Java Architect told me that an EJB container can be scaled better opposed to the Web-container.
But I read somewhere that Stateful session beans don't scale so well.
So what is the best decision? Keep everything in the HttpSession or keep everything in a Stateful session bean? Or is there an even better solution.
What is best for a really big application?
Greetings Manuel
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
put it in the HttpSession. Some containers (websphere) don't failover Stateful session beans.
 
Rudi Vaum
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BLUEPRINT RECOMANDATION:
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.html#1080752
4.4.7.3 Web-Tier State Recommendations
When using enterprise beans, it's best to maintain session state with stateful session beans in the EJB tier. For Web-only applications, maintain the state in the Web tier as session attributes (using HttpSession). The following sections discuss the rationale for these recommendations. [...]
Maintaining session state in stateful session beans is a BluePrints best practice. [...]
MfG Rudi
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what google found for me:
http://www.onjava.com/pub/a/onjava/2001/10/02/ejb.html?page=last&x-showcontent=text
It's worth finding out if your appserver supports stateful session bean failover & how it's implemented.
 
Frank Zheng
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This depends: if your application using enterprise beans, better store your session states in EJB tier using stateful session bean. If your application does not using the EJB, maintain the state in web tier(using HTTPSession) is a wise choice.
Check this:
http://java.sun.com/blueprints/patterns/SessionFacade.html
[ May 21, 2003: Message edited by: Frank Zheng ]
[ May 21, 2003: Message edited by: Frank Zheng ]
 
Venkat Kulkarni
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively you can use the database to store the session information using the session id as the key.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic