Skip to content

Duplicate entry for key PRIMARY #13

@alexbotov

Description

@alexbotov

Hello,

experiencing quite often this error from the local java client:

22-10-2018 20:15:19.842 [http-nio-9900-exec-8] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet].log - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT INTO eventuate.events (event_id, event_type, event_data, entity_type, entity_id, triggering_event, metadata) VALUES (?, ?, ?, ?, ?, ?, ?)Duplicate entry '000001669cc6176a-f6c877a3755e0000' for key 'PRIMARY'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '000001669cc6176a-f6c877a3755e0000' for key 'PRIMARY'] with root cause com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '000001669cc6176a-f6c877a3755e0000' for key 'PRIMARY'

it happens on higher load, I took look at IdGeneratorImpl and maybe there is race condition in genIdInternal (counter = counter + 1)

any clue for the cause?

Cheers,
Alex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions