aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Instance variables and multi-threading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Instance variables and multi-threading" Watch "Instance variables and multi-threading" New topic
Author

Instance variables and multi-threading

Paulus Maessen
Greenhorn

Joined: Sep 29, 2004
Posts: 12
Hi all,

I have a question about the example in the SCWCD exam study kit:

On page 165, listing 10.7 shows a servlet that uses an instance variable to cache a database connection. As I understand it this is not threadsafe.

Right?
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Yep, instance variables are *never* threadsafe.


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
 
 
subject: Instance variables and multi-threading