• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bug in Pet Store 1.0.1

 
Vivek Viswanathan
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Robin Zhang
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going to look at the petstore too. Can you tell how you start to go through it? what server do you use to run it? thx
 
Vivek Viswanathan
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have installed pet store 1.1.2 on j2ee reference implentation 1.3.1. You should get this at java.sun.com
I am going through the source code using JBuilder 6. This is a very good tool for understading existing code since it provides nice features like UML diagrams, searching for variable reference.

vivek
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic