Hi, Wai Mun

Do you mean that every page access generates one file access?  Why don't you put
the counter in the servlet context and synchronize access to the counter
variable?

Regards,
Noel Lecaros

Wai Mun wrote:

> if i need to create a counter for a web page, how do i ensure that there
> will be no other process that try to access the couter file at the same time
> for updating the value in the file? i.e. how do i lock the file for
> exclusive writing?
>
> but if i'm able to lock the file, then how can i effectively update the
> counter, say there are ten people accessing the web page at the same time?
>
> pls advice, thank a lot!
>
> ___________________________________________________________________________
> 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