• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Confusion regarding stateful session bean

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am new to EJB.
Can somebody explain me with example what 'state' is generally referred to? I have raised two different scenario for my understanding.

Scenario 1:-

Suppose I have added 5 different items in a shopping cart. Each time adding the item in cart EJB is calling and finally when I submit the cart it generates the bill. Does Stateful EJB will maintain this state(from client to server and back to same client)?

my Question:- If so then how it distinguish the call from the same client or different client ?

Scenario 2:-

I have a servlet which calls a stateful session bean from its get() method. When the servlet is called one stateful session bean object from instance pool is associated to this servlet's instance variable of bean.

my Question:-
If so then how the state will be kept for different client(or session) when 10 different client will call the same servlet(if servlet instance is same and its associated bean is also same) ?

Please somebody give me the clarification. I am confused.
 
This tiny ad is guaranteed to be gluten free.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic