• Post Reply Bookmark Topic Watch Topic
  • New Topic

File.exists() problem in Mac OS x java 5

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I really have a strange problem and it causes my application to work real slow and the users to have to wait.

My java server creates files in a hotfolder that 3-part program process and delete them when finished. The problem is that File.exists() return true even if the file isn't there.

I have 3 Mac os x computers with Tiger installed and Java 5. My java Server runs on one of them and all 3 servers have the 3-part program installed and my server creates files in the hotfolders that are available. Ex if the 3-part program process a file then I check the next hotfolder and so on.

The file.exists() method takes exactly 1 minute to return false even if the process takes 3 seconds. This only happens over network. It worked fine before the java 5 was installed. Does anyone know the problem.

It's really anoying because the users sits and wait for the browser to present a JPG and it takes a minute for every JPG to be viewed even if the process time was 3 seconds.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, lies from File.exists(), and from other similar methods, are not restricted to Mac OS X. Windows lies, too, though I've not had the lies persist for minutes, as seems to be happening to you.

Basically, you need to write your code to cope with the possibility that results from such functions could be incorrect. This puts you in the unpleasant world of time-outs, retries, fall-backs etc.

Rubbish, innit?!
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok!

So there is nothing to do about this..... Very odd that it worked in java 1.4 and not java 5....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!