3 ms·
Just a reminder to watch out for connection pooling problems when using advisory locks. If you've checked out a connection from your pool that you use from the
by sudhirj 5y ago
Just a reminder to watch out for connection pooling problems when using advisory locks. If you've checked out a connection from your pool that you use from the time you take the lock to the time you release it, you'll be fine. If you operate on the pool itself, or checkout a connection from the pool each time send a query, there's no guarantee you're running subsequent queries on the same connection that you took the lock out on, or that you're releasing the lock you took (if you wind up releasing on a different connection).
I wrote up more details on https://sudhir.io/understanding-connections-pools https://sudhir.io/understanding-connections-pools