Sychronizing the Java method or block is guaranteed to allow only one thread to
access the section of code
0. Have written the method correctly? Can we see it ?
1. Are there other users /apps accessing the same table.
2 .Are you sure that the database table is locked?

--

Peter Pilgrim
Welcome to the "Me Too" generation.



---------------------------------------- Message History 
----------------------------------------


From: [EMAIL PROTECTED] on 05/10/2000 13:47

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Synchronize method in the servlet



Hello,

The synchronized method I created in the servlet is going to increment a number
in the database and display it in the browser. Because I don't want multiple
user update the database at same time, I added synchronized keyword in the
method.

My question is: does synchronize guarantee that only one thread does the update
database? Why after many times of testing multiple browsers, I still got same
number on different threads which means access to the synchronized method is not
exclusive?

many thanks in advance.

Tiana

___________________________________________________________________________
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





--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.

___________________________________________________________________________
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