jQuery in Action, 2nd edition*
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Instance variables and multi-threading