I'm acquiring pessimistic locks (FOR UPDATE NOWAIT) for my application (using sequel db.fetch( <sql code> ) and im writing a test case to verify that a concurrent transaction should fail with error LockNotAvailable. However, for some reason, in one test case (via rspec) the concurrent command to acquire the same lock does not fail. However, if I access the database via psql and do the exact same command, it does fail with that error.
Hmm, so a question. For sequel transactions, if a transaction attempts to acquire a lock via (update no wait), does it actually conflict with anotther transaction (that has yet to be committed) that acquires the same lock? My assumption was that the error would be thrown, but if thats not the case (e.g. the commands in the transaction are not evaluated till later [ optimistic concurrency ]), then its just that my test case has the wr