Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Instance variables and multi-threading

 
Paulus Maessen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, instance variables are *never* threadsafe.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic