Hi,
Would anyone be able to suggest a way that I can
test if a file is done being written to?
scenario:
1. server 1 writes an XML file to a DFS location. This file can potentially be large.
2. (I thought when we were 'done' writing the file) a JMS message is sent to server 2 to read that XML to process the request. However, it seems that many times, server 2 tries to read the file before it has completly been written, and therefore throws a premature EOF exception.
If I force server 2 to retry processing the same file, just seconds later, it is successful.
I thought about just putting in a
thread wait line to make the server 2 process wait 15 seconds, after it receive the JMS message and before it tries to parse the file. But I'm afraid that if one day the file is extremely large, it will still exceed the 15 seconds, and server 2 will still fail. So, I want to have the process from server 2 look at the file and determine if it is complete before trying to parse it.
Thanks for any suggestions.
Lulu