Oracle Community Directory
Oracle Community FAQ
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
Please enter a title.
You can not post a blank message. Please type your message and try again.
Java EE (Java Enterprise Edition)
This discussion is archived
on Nov 23, 2011 7:18 PM by DrClap
Dukes Book example Cart synchronized
Nov 23, 2011 2:32 PM
Going through the Dukes Bookstore examples.
Why are the shopping cart methods synchronized?
If each user only has one session. Then then only access one servlet at a time.
So there is no need to synchronized access to the cart.
That's my thinking, am I wrong, explain it please?
This content has been marked as final.
Show 1 reply
Re: Dukes Book example Cart synchronized
Nov 23, 2011 7:18 PM
in response to
If the user clicks fast enough, or the request processing is slow enough, it's possible to have two requests from the same user being processed at the same time. Hence the need to consider thread safety.