• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stateful Session Bean and clustered environment

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I love a good mentalist. And so does this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic