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

concurrent calls on a stateful bean

 
Sankar Subbiramaniam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the spec "Clients are not allowed to make concurrent calls to a stateful session object. If a client-invoked business method is in progress on an instance when another client-invoked call, from the same or different client, arrives at the same instance of a stateful session bean class, the container may throw the java.rmi.RemoteException to the second client, if the client is a remote client, or the javax.ejb.EJBException, if the client is a local client."

Also when a system excepion is thrown, the bean is destroyed.

Consider the scenario:
Client A calls methodA() on a stateful bean.
Assuming there is a second thread from the client calls the methodA() of the same instance of stateful bean.
Since in this scenario a RemoteException is thrown, the bean will be destroyed.

If so what happens to the first call on methodA() ? Will it also fail ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic