PostgresLockDao

@Component
class PostgresLockDao(entityManager: EntityManager)

Provides distributed locking functionality via Postgres session-level advisory locks.

See also

Constructors

Link copied to clipboard
constructor(entityManager: EntityManager)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
@Transactional(propagation = Propagation.MANDATORY)
fun acquire(id: Long)

Acquires an exclusive session-level advisory lock, waiting if needed.

Link copied to clipboard
@Transactional(propagation = Propagation.MANDATORY)
fun release(id: Long): Result<Unit>

Releases an exclusive session-level advisory lock, waiting if needed.