
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
transaction_retry_continued
Advanced tools
This is a community-driven continuation of the
transaction_retry
gem for retrying database transactions on deadlock and serialization errors. Originally designed to support MySQL, PostgreSQL, and SQLite databases.
The transaction_retry
gem enhances transaction reliability by automatically retrying transactions upon encountering
deadlock and serialization errors in the database.
Add this line to your application's Gemfile
:
gem 'transaction_retry_continued'
And then execute:
bundle install
The gem simplifies transaction retry logic by automatically rescuing ActiveRecord::TransactionIsolationConflict
and
retrying the transaction.
It works out of the box with Ruby on Rails.
If you have a standalone ActiveRecord-based project you'll need to call:
TransactionRetry.apply_activerecord_patch # after connecting to the database
You can optionally configure transaction_retry gem in your config/initializers/transaction_retry.rb (or anywhere else):
TransactionRetry.max_retries = 3
TransactionRetry.wait_times = [0, 1, 2, 4, 8, 16, 32] # seconds to sleep after retry n
This gem was initially developed for and successfully works in production at Kontomierz.pl - the finest Polish personal finance app.
Run tests on the selected database (mysql2 by default):
# passing desired database, active record version and ruby version
docker compose run -e db=sqlite3 -e BUNDLE_GEMFILE=gemfiles/activerecord-7.0/Gemfile.sqlite3 ruby_2_5 bash -c ./docker/test-ruby.sh
# db options: mysql2, postgresql, sqlite3
# active record version options: 5.2, 6.0, 6.1, 7.0
# ruby version options: 2.5, 2.7, 3.0, 3.1
Run tests on all supported databases by ruby version:
docker compose up ruby_2_5
docker compose up ruby_2_7
docker compose up ruby_3_0
docker compose up ruby_3_1
Database configuration is hardcoded in test/db/db.rb; feel free to improve this and submit a pull request.
You should be very suspicious about any gem that monkey patches your stock Ruby on Rails framework.
This gem is carefully written to not be more intrusive than it needs to be:
Released under the MIT license. Copyright (C) 2012 Piotr 'Qertoip' Włodarek.
FAQs
Unknown package
We found that transaction_retry_continued demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.