A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Spring in Action
this week in the
Web Component Certification (SCWCD/OCPJWCD)
Instance variables and multi-threading
Joined: Sep 29, 2004
Sep 30, 2004 06:22:00
I have a question about the example in the SCWCD exam study kit:
On page 165, listing 10.7 shows a
that uses an instance variable to cache a database connection. As I understand it this is not threadsafe.
Joined: Apr 02, 2004
Oct 01, 2004 02:27:00
Yep, instance variables are *never* threadsafe.
SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
It is sorta covered in the
JavaRanch Style Guide
subject: Instance variables and multi-threading
Question about inheritance
Help with recursion
Is final variable i:final int i=0;on stack or heap?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014