Win a copy of AWS Security this week in the Cloud/Virtualization 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

7.11.8 Non-reentrant instances

Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
spec 7.11.8 says :-
"Note that a session object is intended to support only a single client. Therefore, it would be an application error if two clients attempted to invoke the same session object."
Fine... I understand. But my ques is :-

Will this scenario EVER happens in the container???

As far as I understand, the container will be creating another instance of the bean, unless it's an entity bean.
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In a case with the stateless session beans one bean instance can service multiple clients as long as the clients are not concurrent.

I am not exactly sure how to replicate the concurrent access on the same stateless session bean in order to test that the container does throw an error.
I'd say that the client program gets hold of EJBObject(through home create method). Then client runs two threads with each calling methods on this EJBObject. If these two threads invoke a method on the bean (through the same EJBObject) at the same time it will mean we are accessing one bean concurrently. I guess I'll have to try it now

It's never done THAT before. Explain it to me tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic