My servlet handles standard HTTP requests. In doing so, I understand that my web container, currently Tomcat, may decide to spawn more than one thread in order to handle the traffic.
I would like to create a thread, totally independent of handling requests, whose job is to read the database
every day, maybe once a day, and to take action on what it finds there.
How can I do this without getting in the way of the servlet container spawning its own threads for handling HTTP requests?
In what servlet method should I spawn the thread? Can you please provide a complete code example?
I am not very experienced with threads and the different ways to create them.