Marcos,
You need to make the piece of code thread-save...so that the servletthread
cannot be interrrupted between the read, ++ and the write code.
Dirk
Internet Mail Message
Received from host: mail.javasoft.com
[204.160.241.28]
Envelope Sender: [EMAIL PROTECTED]
From: Marcos <[EMAIL PROTECTED]> on 10/07/2000 01:36 PM
Please respond to "A mailing list for discussion about Sun Microsystem's Java
Servlet API Technology." <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Dirk Struyf-D/PGI)
Subject: sharing i/o file
hi,
i have running a sevlets that reads from a file a number and it adds
one more. after changes it saves.
i want to use the same file from another servlet. any problem?? if
both servlets try to open and save at the same time.
file = 4455
servlet 1 servlet2
{ {
read from file 4455 read from file 4455
++ ++
4456 4456
save save
} }
it is wrong. in file should be 4457.
thanks in advance,
marcos
[EMAIL PROTECTED]
___________________________________________________________________________
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