We recently changed our system to keep the latest data in the memory instead of writing to the database. (it will be written to the database when the I/O is relatively free)
However, now we are stuck if in the event of Shutdown is required, there might be some data that have not written to the Database yet.
Is there anyway in Tomcat to trigger a call either a servlet method or some sort to perform action when a "shutdown" is issue to tomcat? We are using the following setup:
OS: Windows Server 2008
Tomcat: 5.5.30
Any idea how to perform the above?
Note: at the moment, we shutdown the tomcat from the windows services.