• Post Reply Bookmark Topic Watch Topic
  • New Topic

must i synchronize the access to stateful session bean?  RSS feed

 
zb cong
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
there is a class named "WebClientControllerImpl" in the petstore1.3,it is a proxy between the web tier and the ejb tier,in the statement,it tell me:

all the method that access the ejb are synchronized,so that concurrent requests do not happen to the stateful session bean.

why,i wonder if the access to the STATEFUL session bean must be synchronized?who can tell me?
thank you!
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You dont need to. If the container receives call from more than one client it will throw RemoteException. Some container queue the client requests.
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds completely un-nessecary to me. On the contrary, I'd actually think that synchronizing it would be bad (based on your description).
What is the context of this class? Is there one per session, or one for all?
[ September 02, 2003: Message edited by: Dana Hanna ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!