Duplicate Entry / process run twice

Certified Senior Developer

Hello Folks,

I got this below error in my process. I am not updating anything in the process. Please assist

An error occurred while trying to write to the entity "EMP_CASE " [id=916ee3cb-938e-4931-a61b-ba630fe5a543@61527, type=EMP_CASE (id=5350)] (data store: EMP Main DS). Details: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement: org.hibernate.exception.ConstraintViolationException: could not execute statement: java.sql.SQLIntegrityConstraintViolationException: (conn=7948467) Duplicate entry '229' for key 'EmpID': org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Duplicate entry '229' for key 'EmpID': java.sql.SQLException: Duplicate entry '229' for key 'EmpID' Data: TypedValue[it=5351,v={{<null>,229,eFront,89777,<null>,<null>,Open,0,TEST,Case,1,1,0,,1.0,56777,<null>,<null>,,,<null>,,<null>,,<null>,,<null>,,<null>,2024-09-16 17:43:20.39}}]

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to manjit.1486

    May I ask why the 'EmpID' is configured as a unique key column in the Employee case table?

    Since it is a unique key, it will prevent the insertion of case details with the same employee ID multiple times, meaning multiple cases cannot be created for or by the same employee. If the relationship is intended to be one-to-one, this makes sense. Otherwise, I would suggest removing the unique key constraint from the 'EmpID' column in the Employee case table.

Children