Added code to handle duplicate commits (where the database committed, but we didn't get the memo).