This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Stateful Session Bean and clustered environment  RSS feed

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java BluePrint PetStore Application shopping cart was implemented as SFSB.

"The shopping cart module implementation is a straightforward stateful session bean,
which maintains a collection of CartItem objects in a private HashMap.
EJB-tier components may access the shopping cart module directly. The Web
tier maintains a reference to the EJB-tier controller in an HttpSession attribute.
The EJB-tier controller’s method getShoppingClientFacade returns a reference to
a ShoppingClientFacadeLocal interface. The shopping client facade’s
getShoppingCart method returns the current session’s shopping cart."

And I'm going to implement my shopping cart in the same way.

But! I wonder if this decision can be applied in clustered environment

I mean situation when there are two or more hosts with installed web server and application server on each and load balancer.

Please help guys! It's very important for my SCEA assignment.
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The J2EE specification does not require support for clustering so I don't think it is within the scope of the exam.

Even if it was, most J2EE container provide clustering and failover support for SFSBs. For the purpose of the assignment, you may choose to make an 'assumption' that the container will support clustering if needed.

In WebSphere for example, you can configure failover for an SFSB at the module, application or entire server level. WebSphere uses a so called Data Replication Service to replicate the session data among cluster members. If a member fails, another member of the cluster picks up the request and retrieves data from the shared repository. Depending on the container you choose to use, there are quite a few design, deployment and configuration considerations will apply to make the failover work.
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!