Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invoke a cleanup of java thread, when it is killed by JVM ..externally

807580May 8 2010 — edited May 8 2010
Hi 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2010
Added on May 8 2010
2 comments
540 views