RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in