diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2016-08-04 14:39:09 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2016-08-04 14:39:09 -0700 |
commit | ac76d551ce1dbb829d521a57a4000b8ce49418f2 (patch) | |
tree | 78b3269ea652c8dcb7132140cdf6bce237e0ada5 /activerecord/lib | |
parent | 4f5a9890b70a426909a40ade94a013f5253b0421 (diff) | |
download | rails-ac76d551ce1dbb829d521a57a4000b8ce49418f2.tar.gz rails-ac76d551ce1dbb829d521a57a4000b8ce49418f2.tar.bz2 rails-ac76d551ce1dbb829d521a57a4000b8ce49418f2.zip |
The problem isn't the detection but the deadlock itself
Diffstat (limited to 'activerecord/lib')
3 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index acc21866f1..5e9705e02f 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -753,7 +753,7 @@ module ActiveRecord when ER_DATA_TOO_LONG ValueTooLong.new(message) when ER_LOCK_DEADLOCK - DeadlockDetected.new(message) + Deadlocked.new(message) else super end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index e213c991c8..d8a50ca96a 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -407,7 +407,7 @@ module ActiveRecord FOREIGN_KEY_VIOLATION = "23503" UNIQUE_VIOLATION = "23505" SERIALIZATION_FAILURE = "40001" - DEADLOCK_DETECTED = "40P01" + DEADLOCKED = "40P01" def translate_exception(exception, message) return exception unless exception.respond_to?(:result) @@ -421,8 +421,8 @@ module ActiveRecord ValueTooLong.new(message) when SERIALIZATION_FAILURE SerializationFailure.new(message) - when DEADLOCK_DETECTED - DeadlockDetected.new(message) + when DEADLOCKED + Deadlocked.new(message) else super end diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb index 3f75ce4099..03e6e1eee3 100644 --- a/activerecord/lib/active_record/errors.rb +++ b/activerecord/lib/active_record/errors.rb @@ -300,9 +300,9 @@ module ActiveRecord class SerializationFailure < TransactionRollbackError end - # DeadlockDetected will be raised when a transaction is rolled + # Deadlocked will be raised when a transaction is rolled # back by the database when a deadlock is encountered. - class DeadlockDetected < TransactionRollbackError + class Deadlocked < TransactionRollbackError end # IrreversibleOrderError is raised when a relation's order is too complex for |