File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Stateful Session Bean and clustered environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Stateful Session Bean and clustered environment" Watch "Stateful Session Bean and clustered environment" New topic

Stateful Session Bean and clustered environment

Denis Meleshko

Joined: Sep 23, 2008
Posts: 7
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.

Chintan Rajyaguru
Ranch Hand

Joined: Aug 19, 2001
Posts: 341
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. - Coming soon!
I agree. Here's the link:
subject: Stateful Session Bean and clustered environment
It's not a secret anymore!