Hi,

Do not let the servlet read&write the file.  Make use of the Singleton
pattern to create a single static instance of a class which does this
for you.  The different servlets then access this class to get the
values.

See for more patterns...
http://c2.com/cgi/wiki?DesignPatterns

At 01:36 PM 2000/07/10, Marcos wrote:
>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

-Deon
------------------------------------------------------------------
Cellpoint SA (Pty) Ltd.        | GSM data communication solutions
http://www.cellpt.co.za        | http://labs.cellpt.co.za/~deon
Voice: +27-(0)11-254-5100      | Fax: +27-(0)11-805-6053

___________________________________________________________________________
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