> From: David Kerber [mailto:[EMAIL PROTECTED] 
> Subject: How does Synchronized code interact with other applications

This has nothing to do with Tomcat.

> If I use a Synchronized block around my code that does the 
> writing to disk, will the Delphi app (assuming competent 
> programmers) be able to monitor and read that file without
> me closing it after each write?

The synchronized attribute and statement only operate within a given
JVM.  If all your apps are running in the same JVM (obviously not the
case here), synchronized will be effective.

The answer to your question depends largely on the OS you're using
(which you didn't tell us).  It's the filesystem you're using that
determines whether or not it's safe for one process to read from a file
that another is writing at the same time.

Depending on the OS, the Delphi app may or may not have to reopen the
file to detect that it's been extended, and will have to handle partial
lines.  The Java app shouldn't have to open and close each time, but may
have to use FileOutputStream.getFD().sync() to insure the data is
actually written out in a timely fashion.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to