• 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

Stateless Session Bean access by multiple clients

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic