Process execution fails due to unique constraint violation

Solution In Progress - Updated -

Issue

Randomly, process execution fails due to a violation of the primary key constraint on different tables.

Here is an example including DEBUG level logging for Hibernate using Postgres:

 11:31:19,092 DEBUG SQL:104 - insert into SessionInfo (lastModificationDate, rulesByteArray, startDate, OPTLOCK, id) values (?, ?, ?, ?, ?)
 11:31:19,092 TRACE BasicBinder:72 - binding parameter [1] as [TIMESTAMP] - <null>
 11:31:19,093 TRACE BasicBinder:72 - binding parameter [2] as [BLOB] - <null>
 11:31:19,093 TRACE BasicBinder:84 - binding parameter [3] as [TIMESTAMP] - Mon June 04 11:31:19 2018
 11:31:19,093 TRACE BasicBinder:84 - binding parameter [4] as [INTEGER] - 0
 11:31:19,093 TRACE BasicBinder:84 - binding parameter [5] as [BIGINT] - 1188
 11:31:19,094  WARN SqlExceptionHelper:144 - SQL Error: 0, SQLState: 23505
 11:31:19,094 ERROR SqlExceptionHelper:146 - ERROR: duplicate key value violates unique constraint "sessioninfo_pkey"
  Detail: Key (id)=(1188) already exists.

When using Oracle, the error is similar to this one:

Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SYS_C007703) violated

When we look at the tables where the insert statement failed, we noticed that there are gaps in the id values. What is the reason for these gaps, and is it related to the sporadic constraint violations?

Environment

  • JBoss BPM Suite
    • 6.4.0
  • JBoss EAP
    • 7.0
  • PostgreSQL
  • Oracle

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.