B Seven
B Seven

Reputation: 45943

What happens if an error occurs during a Rails Pessimistic Lock?

Pessimistic Lock creates a transaction. What happens if there is an error during the transaction and it does not complete?

Using PostgreSQL.

Upvotes: 0

Views: 88

Answers (1)

Bill Doughty
Bill Doughty

Reputation: 2310

The transaction is aborted and the lock is released. Since the transaction is aborted, no updates made in the transaction prior to the exception are committed.

http://www.postgresql.org/docs/9.1/static/explicit-locking.html

Upvotes: 1

Related Questions