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

**URL:** <https://forum.inductiveautomation.com/t/java-sql-batchupdateexception-duplicate-entry-for-key-primary/61477>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [July 4, 2022, 7:09am UTC](https://forum.inductiveautomation.com/t/java-sql-batchupdateexception-duplicate-entry-for-key-primary/61477 "2022-07-04T07:09:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [July 4, 2022, 7:09am UTC](https://forum.inductiveautomation.com/t/java-sql-batchupdateexception-duplicate-entry-for-key-primary/61477/1 "2022-07-04T07:09:45Z")

</div>

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?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/b/5b382bbfa9658065ddfeb46e34969a7e952d7a1f.png)

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

---

<div class="post-metadata">

**Author:** ![avaughn](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/avaughn/32/38972_2.png) [@avaughn](https://forum.inductiveautomation.com/u/avaughn)\
**Post date:** [July 13, 2022, 9:37pm UTC](https://forum.inductiveautomation.com/t/java-sql-batchupdateexception-duplicate-entry-for-key-primary/61477/2 "2022-07-13T21:37:30Z")

</div>

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](https://docs.inductiveautomation.com/display/DOC81/Edge+Sync+Services#EdgeSyncServices-SyncReset).

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

---

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [July 14, 2022, 7:06am UTC](https://forum.inductiveautomation.com/t/java-sql-batchupdateexception-duplicate-entry-for-key-primary/61477/3 "2022-07-14T07:06:24Z")

</div>

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