Person Update leads to DuplicateEntryException in the Logging Plugin

Create issue
Issue #2932 new
Tom Völker created an issue

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:

  1. When preparing the Person Update also update the PersonChangeID of the old Person to a new, unused ID.
  2. 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.
  3. Adding an ON DUPLICATE KEY UPDATE query the logPersonUpdate Query, which should also fix the problem but maybe lead to unexpected cascading issues.

Comments (3)

  1. Log in to comment