java.sql.BatchUpdateException:Duplicate entry for key 'PRIMARY'

Hi all,

I have noticed an issue with history data not being stored, when looking at store and forward engine there is a significant about of quarantined data with the following “Duplicate entry” error?

What methods and behavior should I be looking at in order to debug this issue?

Hello Liam,

I would suggest first looking at configurations that are set to store data twice to the same database. A few examples of this would be a tag history splitter that’s pointing to multiple instances of the same database, the second scenario would be a configuration with central and remote gateways that are both set to store tag history to the same database. Another scenario would be if you have a remote edge gateway syncing tag history and have performed a reset on the SyncID as mentioned here.

Outside of those scenarios, I would suggest exporting the quarantine file and investigating the tags that are flagging duplicate data being stored.

We managed to figure out that this error was caused by our middleware sending birth certificates with timestamped data.

1 Like