• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Stateless Session Bean access by multiple clients

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page 238 Head First EJB book states Session Beans must NEVER be accessed by more than one client. If a bean is currently in use by a lcient and another client invokes a method on the bean that secone client gets an Exception.

My query , is this statment is refering to same bean or different bean but having same Home? If its same home then different client is allowed to run different methods on different Bean at a same time.
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it refers to the same component interface (bean), not the home interface. Obviously, EJB wouldn't be very scaleable if you could literally only access a single bean of each type across your entire enterprise.

As you mentioned, the general rule is that stateful session beans belong to one single client. Stateless session beans do not have this restriction.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two clients can never access business methods in a session bean at the same time. This holds good even for stateless session beans. For stateless session beans, the same bean can be reused to handle calls from multiple clients; but not concurrently.
    Bookmark Topic Watch Topic
  • New Topic