No private is an access modifier, not a replication or synchronization keyword.  All that it means is that only the specific class can access the data (not the specific instance).  You have to remember that Servlets use a single instance of your servlet class to serve all the requests that come in.  Often those requests will come in at the same time and you'll have multiple threads running through a single instance of your servlet.  Anything on the stack ( i.e. method local variables and  arguments) are inherently threadsafe, anything else you must explicitly synchronize yourself.
  (*Chris*)

On 2/6/06, vcragain <[EMAIL PROTECTED]> wrote:
Hi -
Can someone please de-confuse me - If I have a public servlet class, with
ONLY private variables, how could the data get overlaid - isnt private data
supposed to be owned by the specific object ONLY ?
Since we just invoke the servlet via the html - is there only 1 instance of
the code ie 1 object invoked...therefore whoever he is referenced by last,
owns his data ?

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to