The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Thread dysfunctioning in swing application

Hi,

We have a desktop application developed in swings, for sending and receiving files between servers using threads, one thread polls the source folder every 1 minute for the specific extention files, if found it send files to the destination server, and copy the sent files to another folder in the local server and delete them from the source folder and vice versa for receiving, the application runs non stop on the server.
Ideally at any point of time only one thread (as the sendfile() function is synchronized) should be running for seding,moving and deleting the files every minute which is getting logged into a log file, but a few days ago a file was sent twice with in the same polling interval, after checking the logs we found that the the file could not be deleted by the running thread as it was being used by another process and that process seems to send it for the second time. If one thread is functioning at a time what could be the reason behind this discrepancies, is it OS related thread malfunctioning.

Server configuration -
we are using Windows 2003 and JRE1.5.
application exe has been developed using jdk 1.5

We thought of OS or thread issue as the same version of application is running on the server since last two years and it never behaved like that, and after taking a restart of the server now its working fine till date .... only one version and one instance of application is running on the server.. still wondering what could be the reason of this unexpacted behaviour of the app ..