A question regarding the use of threads in
J2EE application. I do understand that J2EE doesnt subscribe to applications using their own threads. However, there are situations where in using a daemon
thread would prove beneficial. For instance if we have a file that we would need to track for changes - we could have a thread (that is spawned from a web application) that monitors this file for change periodically. The benefit of this approach is that a file change can be made to re-parse the file thus avoiding unnecessary server re-starts.
The premise that J2EE uses against application using threads is that too many threads could interfere with the containers activities. I did use such a thread(as explained above) to periodically (twice a day) check for file changes - and didnt find any major issues.
Now, if we have a thread that periodically checks for changes - would there be any serious drawback ?