I have a java application consisting of a Thread that monitors a table in the database that contains shell scripts to be executed. I look up the database, every few seconds. for a script, execute it (via the Process class), and wait for another script in the table.
My problem is: At times, some command in the script fails. The thread captures the error stream and logs it in the database. However, it keeps logging the messages and the control doesn't return from the script to the Java Thread due to which the subsequent shell scripts in the database are unable to execute.
Is there a work around for this?