Update deadlock_retry plugin with latest upstream code.

This commit is contained in:
Tom Hughes 2009-06-05 23:07:10 +00:00
parent edcd4af496
commit 2b9f430908
2 changed files with 33 additions and 2 deletions

View file

@ -44,6 +44,7 @@ module DeadlockRetry
begin
transaction_without_deadlock_handling(*objects, &block)
rescue ActiveRecord::StatementInvalid => error
raise unless connection.open_transactions.zero?
if DEADLOCK_ERROR_MESSAGES.any? { |msg| error.message =~ /#{Regexp.escape(msg)}/ }
raise if retry_count >= MAXIMUM_RETRIES_ON_DEADLOCK
retry_count += 1