Skip to main content

Error: GenericJDBCException: ERROR: deadlock detected

Two processes are attempting to modify the same record.

Written by Petr Pech

Error

GenericJDBCException: ERROR: deadlock detected

What the error means

A deadlock occurred in database operations.

Typically:

  • two processes or users are simultaneously working with related records

  • each of them holds a portion of so-called locks (blocking changes from another source)

  • while at the same time waiting for a lock held by the other process

👉 The database identifies this situation as a deadlock and terminates one of the operations with an error.

Resolution

  • retry the operation

  • ensure that the same record is not being edited by multiple users at the same time

  • for bulk operations, limit the concurrent execution of multiple actions on the same data

Did this answer your question?