Invoke a cleanup of java thread, when it is killed by JVM ..externally
807580May 8 2010 — edited May 8 2010Hi All
I have J2SE application running in linux. I have stop application script in which i am doing kill of the J2SE pid. This J2SE application has 6 infinitely running user threads,which will be polling for some specific records in backend DB.
When this java pid is killed, I need to perform some cleanup operations for each of the long running thread, like connecting to DB and set status of some transactions which are in-progress to empty.
Is there a way to write a method in each of the thread, which will be invoked when the thread is going to be stopped, by JVM.