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.
posted 12 years ago
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.
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.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads