Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stateless Session Bean access by multiple clients

 
vishal mehta
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.
 
Nathaniel Stoddard
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.
 
Kaarthik Sivashanmugam
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic