Trying to stop re-processing the same records by adding manual locking