Could the process not delete the row, and not commit until it has finished processing? Otherwise, the transaction is rolled back when the db connection ends. This would not require timeout or clean-up.
One would need the appropriate transaction isolation, but shouldn't it work?
One would need the appropriate transaction isolation, but shouldn't it work?