My situation:
There is a analysis operation in our Java EE application, this function is implemented by executing a Batch Command using java.lang.Runtime. The most serious matter is that this operation would take a long time, and during execution, some errors would be encountered, and then the whole process tree is still alive, which undoubtedly lower the performance of application and server. So I was wondering that anybody can please offer a idea to safely and correctly solve this issue.
And I know that this is a very common question in our development, I will be greatly appreciated if there is a example provided here.