Hi
I am going through Pet Store 1.0.1 as a part of my Assignment, I think I have found a coding (desing) error. Could some one confirm this.
The
EJB 1.1 specification (� 6.5.6) specifically disallows multiple simultaneous accesses to the same stateful session bean.
The EJB container throws a RemoteException if a client accesses a stateful session bean that is already serving a request from another client.
This problem has been taken care of in the case of ShoppingClientControllerWebImpl class (this class is in the web tier and it acts as a proxy to the session bean in the EJB Tier)in this class the method calls are synchronized.
But in the case of the other Session Bean Class ( and the corresponding Proxy Classes in the Web Tire )
i.e
ShoppingCartEJB (session bean ) and ShoppingCartWebImpl ( web tier proxy class )
Whenever a method is accsed in ShoppingCartWebImpl the methods are not synchronized, hence we will get a RemoteException as stated in the EJB Specification. The method 'getDetails' on ShoppingCartEJB is called from the method 'performUpdate' in ShoppingCartWebImpl
this method is called when the all the models are updated in
RequestProcessor
public void processRequest(HttpServletRequest req) {
.....
mun.notifyListeners(updatedModelList);
....
}
thanx
Vivek V
Vivek Viswanathan SCJP 1.2, SCJP 1.6,SCJD,SCEA,SCWCD,IBM-484,IBM-486,IBM-141,Ms.NET C# 70-316,SCMAD, LPIC-I