5.1.0 (2024-01-21)
- use zeitwerk loader instead of ActiveSupport::Autoload (b5082fd)
- add release workflow (5d32520)
- add ruby 3.1 test/support (#60) (514f042)
- Add testing for activerecord 7.1 and support for trilogy adapter (#77) (69c23fe)
- add truffleruby support (#62) (ec34bd4)
- Drop support for EOL rubies and activerecord (ruby below 2.7 and activerecord below 6.1).
- Allow lock name to be integer
- Jruby support
- Truffleruby support
- Add
with_advisory_lock!
, which raises an error if the lock acquisition fails - Add
disable_query_cache
option towith_advisory_lock
- Drop support for mysql < 5.7.5
- Support for ActiveRecord 6
- Add Support for nested locks in MySQL
- Drop support for unsupported versions of activerecord
- Drop support for unsupported versions of ruby
- Joshua Flanagan added a SQL comment to the lock query for PostgreSQL. Thanks!
- Fernando Luizão found a spurious requirement for
thread_safe
. Thanks for the fix!
- Joel Turkel added
require 'active_support'
(it was required, but relied on downstream gems to pull in active_support before pulling in with_advisory_lock). Thanks!
- Jason Weathered Added new shared and transaction-level lock options (Pull request 21). Thanks!
- Added ActiveRecord 5.0 to build matrix. Dropped 3.2, 4.0, and 4.1 (which no longer get security updates: http://rubyonrails.org/security/)
- Replaced ruby 1.9 and 2.0 (both EOL) with ruby 2.2 and 2.3 (see https://www.ruby-lang.org/en/downloads/)
- Added jruby/PostgreSQL support for Rails 4.x
- Reworked threaded tests to allow jruby tests to pass
yield_with_lock_and_timeout
andyield_with_lock
now return instances ofWithAdvisoryLock::Result
, so blocks that returnfalse
are not misinterpreted as a failure to lock. As this changes the interface (albeit internal methods), the major version number was incremented.with_advisory_lock_result
was introduced, which clarifies whether the lock was acquired versus the yielded block returned false.
- Lock timeouts of 0 now attempt the lock once, as per suggested by Jon Leighton and implemented by Abdelkader Boudih. Thanks to both of you!
- Pull request 11 fixed a downstream issue with jruby support! Thanks, Aaron Todd!
- Added Travis tests for jruby
- Dropped support for Rails 3.0, 3.1, and Ruby 1.8.7, as they are no longer receiving security patches. See http://rubyonrails.org/security/ for more information. This required the major version bump.
- Refactored
advisory_lock_exists?
to use existing functionality - Fixed sqlite's implementation so parallel tests could be run against it
- Releasing 1.0.0. The interface will be stable.
- Added
advisory_lock_exists?
. Thanks, Sean Devine, for the great pull request! - Added Travis test for Rails 4.1
- Explicitly added MIT licensing to the gemspec.
- Merged in Postgis Adapter Support to address issue 7 Thanks for the pull request, Abdelkader Boudih!
- The database switching code had to be duplicated by Closure Tree,
so I extracted a new
WithAdvisoryLock::DatabaseAdapterSupport
one-trick pony. - Builds were failing on Travis, so I introduced a global lock prefix that can be set with the
WITH_ADVISORY_LOCK_PREFIX
environment variable. I'm not going to advertise this feature yet. It's a secret. Only you and I know, now. shhh
- Addressed issue 5 by using a deterministic hash for Postgresql + MRI >= 1.9. Thanks for the pull request, Joel Turkel!
- Addressed issue 2 by using a cache-busting query for MySQL and Postgres to deal with AR value caching bug. Thanks for the pull request, Jaime Giraldo!
- Addressed issue 4 by
adding support for
em-postgresql-adapter
. Thanks, lestercsp!
(Hey, github—your notifications are WAY too easy to ignore!)
- Added Travis tests for Rails 3.0, 3.1, 3.2, and 4.0
- Fixed MySQL bug with select_value returning a string instead of an integer when using AR 3.0.x
- Only require ActiveRecord >= 3.0.x
- Fixed MySQL error reporting
- Asking for the currently acquired advisory lock doesn't re-ask for the lock now.
- Introduced NestedAdvisoryLockError when asking for different, nested advisory locksMySQL
- Moved require into on_load, which should speed loading when AR doesn't have to spin up
- Fought with ActiveRecord 3.0.x and 3.1.x. You don't want them if you use threads—they fail predictably.
- Added warning log message for nested MySQL lock calls
- Randomized lock wait time, which can help ameliorate lock contention
- First whack