Is two or more users can use the same instance of a
Session Bean or Entity Bean?.
How the EjBContext was Handling by the WebContaineer
for stateful Session Beans.
Is two threads can use one instance of Session Bean or
Any reply will be highly appreciated..
Stateful session beans----technicaly NO
Stateless Session beans---YES
the container maintains a history of the contexts that have accessed a particular sharable object and when a context switching occurs it performs a look up for that particular user details...
Just now i some where in the ejb document that no two threads can use the same instance of Session or entity bean.
two users/clients canuse the same instance of a stateless session bean, but not the stateful session bean.
because when a stateful session bean goes for passivation it is passivated with session values to that particular client.and then freed.
this is the same case applicable to entity beans too.
container assigns seperate instances from the pool even though, the clients are accessing the same data.