I have a Java web application hosted on a Tomcat server. This web application serves http requests. Now, I need to execute a Java program that interacts with the database and perform some tasks nightly. This Java program needs to run on its own thread and should not cause Tomcat to crash/terminate for any reason (obviously will have try-catch blocks, but still).
And yeah, I don't want to run a cron job in the background. I want the web application to execute the program at a certain time right after deployment.
How can I do this?