Hi there,
a relative common error in a
java ee application is costituited by methods which result in hung threads (tipically because of an infinite loop, locks, conn leaks and so on). As far as I know, there is no way to forcibly stop a
thread from outside in java.Common workarounds i have seen comprehend a thread hung notification system provided by appserver itself, but at the very end the only way to get rid of hung threads is to restart the jvm. That's a drastic solution. I wonder if there is a way to implement a kind of "thread execution timeout". In theory, if a thread could be made aware of the fact it's taking to long to execute its task,it may quits execution.
Any suggestion?