Open stinovlas opened 1 month ago
It a bug.
For a transaction level PG advisory lock, there is no unlock or release.
So, a warning message is shown when invoking release
or close
. But the warning is shown mistakly in the with
statement, because close
is called implicitly in __exit__
.
Hi! When I use following code, it produces warnings:
This is caused by
__exit__
method of the lock callingclose
, which callsrelease
. However, there's no release for transaction scoped (xact) PostgreSQL advisory lock. It could be fixed by overriding theclose
method inPostgresqlSadLock
and checking forself._xact
value.