I am using Spring ThreadPoolTaskExecutor to execute tasks. I want to know the status of the thread in ThreadPoolTaskExecutor, like whether it is finished or in progress or completed. If the task executing thread fails I need to update the subsequent entry of task in taskInfo table to "failed". I have tried the isAlive method of thread to check the thread status but it is always returning true status. What is the best way to know the exact status of a thread in ThreadPoolTaskExecutor.