nalla srinivas wrote:yes
K. Tsang OCPJP OCMJEA SOACP PMP
K. Tsang wrote:
nalla srinivas wrote:yes
Not true. In order to write thread-safe servlets, you need explicitly make it thread-safe by either synchronizing the code block or implement the SingleThreadModel (which I think is deprecated).
Bear Bibeault wrote:It's a very bad idea to [...] use synchronization
Ulf Dittmer wrote:Like everything, synchronization can be misused, but there's nothing wrong with it to make an absolute statement like this true.
Bear Bibeault wrote:
K. Tsang wrote:
nalla srinivas wrote:yes
Not true. In order to write thread-safe servlets, you need explicitly make it thread-safe by either synchronizing the code block or implement the SingleThreadModel (which I think is deprecated).
Also not accurate. It's a very bad idea to either use synchronization, or to use the deprecated SingleThreadModel.
Rather, the servlet needs to be written in a thread-safe manner. 99% of that is avoiding instance variables.
we can make threadsafe by using SingleThreadModel
Ankur Garg (SCJP,SCWCD)
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
|