Skip to main content

Error: ERROR: could not obtain lock on relation

Database Record Locking Issue (PostgreSQL)

Written by Petr Pech

This article applies only to on-premise (server / local) installations of ABRA Flexi.

This error means that a lock on a database table could not be obtained. Typically, the table is already being used by another process.


Most common causes:

  • terminated or "hanging" connections on the server

  • concurrent operations on the same data (e.g. API calls)

  • long-running transactions


How to resolve the issue:

  • restart ABRA Flexi Server

  • if the issue recurs:

    • check your API connections (frequent or parallel requests)

    • limit concurrent operations on the same data


Recommendation:

  • use a server configured with autoUpgrade (helps prevent similar issues)

Did this answer your question?