with_advisory_lock icon indicating copy to clipboard operation
with_advisory_lock copied to clipboard

Connection pool causing locks to be taken when they shouldn't

Open mikebaldry opened this issue 3 years ago • 1 comments

During testing I found that (at least in my set up), ActiveRecord was re-using connections in which advisory locks were held, so when trying to lock on one again, even though it is locked, as it is within the same session.

I'm not sure if I'm doing something wrong but I can't guarantee the connection that is used to take the lock, so I can't guarantee this is locking correctly all the time.

Can anyone shed some light on to this issue?

mikebaldry avatar Sep 21 '20 13:09 mikebaldry

Version of AR and database type/version will be helpful.

seuros avatar Jul 31 '22 08:07 seuros