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:
quote:
--------------------------------------------------------------------------------
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!
-
must i synchronized the access to the STATEFUL session bean? (3 messages)
- Posted by: u u
- Posted on: September 02 2003 06:23 EDT
Threaded Messages (3)
- must i synchronized the access to the STATEFUL session bean? by Mushtaq Ahmed on September 02 2003 09:35 EDT
- must i synchronized the access to the STATEFUL session bean? by Paul Strack on September 02 2003 10:27 EDT
- must i synchronized the access to the STATEFUL session bean? by Leonard Gurevich on September 02 2003 11:34 EDT
-
must i synchronized the access to the STATEFUL session bean?[ Go to top ]
- Posted by: Mushtaq Ahmed
- Posted on: September 02 2003 09:35 EDT
- in response to u u
Hi,
When u call a stateful session bean instance,
EJB container quarantees that no other clients r using that instance.
The container exclusively holds the bean instance and directs concurrent clients to other instances.
or make them wait untill u'r done with that instance.
U do not need to code u'r beans as thread safe.
Regards
Mushtaq -
must i synchronized the access to the STATEFUL session bean?[ Go to top ]
- Posted by: Paul Strack
- Posted on: September 02 2003 10:27 EDT
- in response to u u
The specifications states that a Stateful session bean should be dedicated to a single client. Since only one client can use the bean, concurrent access should never occur, and synchronization should be a non-issue. -
must i synchronized the access to the STATEFUL session bean?[ Go to top ]
- Posted by: Leonard Gurevich
- Posted on: September 02 2003 11:34 EDT
- in response to Paul Strack
The specifications states that a Stateful session bean should be dedicated to a single client. Since only one client can use the bean, concurrent access should never occur, and synchronization should be a non-issue.
Not exactly. If clients are using multiple threads it could occur.
Also it could occur in web based applications when user click submit button several times or there are several frames send requests to the same SFSB.