When trying to update the person page of a.hotho on biblicious, the update fails due to a
DuplicateEntryException in the logging plugin. The problem arises because the
PersonChangeID of the old person is not updated if the person update fails after the logging has taken place. In this case, the old person remains in the database with the old
PersonChangeID, resulting in a duplicate entry when the logging utility is called again with the next Person Update action.
From my understanding there are three possible solutions to this problem:
- When preparing the Person Update also update the PersonChangeID of the old Person to a new, unused ID.
- Changing the logPersonUpdate Query to an
INSERT IGNOREquery, which bypasses the error completely, but may not log the most recent version of the old person.
- Adding an
ON DUPLICATE KEY UPDATEquery the logPersonUpdate Query, which should also fix the problem but maybe lead to unexpected cascading issues.