Auto-retry transactions on deadlocks in a db-agnostic way
I recently published transaction_retry gem. It’s like good old deadlock_retry but works across all major databases, is well tested against Rails 3.x and supports all isolation levels (not only the default REPEATABLE READ). The gem was extracted from a large financial application and comes with good test coverage. Give it a try if you see errors like these:
MySQL Deadlock found when trying to get lock Lock wait timeout exceeded
PostgreSQL deadlock detected could not serialize access
SQLite The database file is locked A table in the database is locked Database lock protocol error
Post a comment