Duplicate Object ID

Hi guys, We are experiencing the following error in our QA environment: Caused by: com.mendix.core.CoreRuntimeException: Failed to commit at com.mendix.basis.component.CommitHandler.commit(CommitHandler.scala:151) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.connectionbus.data.UniqueConstraintViolationRuntimeException: Duplicate column value violates its unique constraint: ERROR: duplicate key value violates unique constraint "modulename$entityname_pkey" We’ve been going to and through with Mendix support on this a bit. Support says it’s an implementation issue. However, we have observed the following: The tables afflicted are not within the same module The ID’s that already exist is older data (the youngest existing data was 10 days old) The data with the same IDs was not invoked by the system when the error was experienced We haven’t been able to replicate the issue locally and suspect that a deploy may have caused the seeding of the object ID to break to some extent. Does anyone know how the seeding of the object IDs work? Or has anyone experienced something similar?
1 answers

I have seen this happen locally on a postgres database when a backup was restored without cleaning the database first.

Cleaning from the commandline uses the --clean optionlike in the statement below:

pg_dump -U username --clean | pg_restore -U username

This creates a backup, then drops the database objects and then restores the database.

Another option would be to drop and recreate the database.