aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
diff options
context:
space:
mode:
authorErol Fornoles <erol.fornoles@gmail.com>2016-05-21 19:25:01 +0800
committerErol Fornoles <erol.fornoles@gmail.com>2016-05-21 21:51:52 +0800
commit4d525a6f7569d1c90811f6d5e326321fb6f25015 (patch)
tree5a0b57e7afcf884cf0b9b43eb49e948c7896f1ea /activerecord/lib/active_record/errors.rb
parent694cbbf801e46d7ec533ece4637412838f02723e (diff)
downloadrails-4d525a6f7569d1c90811f6d5e326321fb6f25015.tar.gz
rails-4d525a6f7569d1c90811f6d5e326321fb6f25015.tar.bz2
rails-4d525a6f7569d1c90811f6d5e326321fb6f25015.zip
Add AR::TransactionSerializationError for transaction serialization failures or deadlocks
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r--activerecord/lib/active_record/errors.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index b8b8684cff..38e4fbec8b 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -285,6 +285,16 @@ module ActiveRecord
class TransactionIsolationError < ActiveRecordError
end
+ # TransactionSerializationError will be raised when a transaction is rolled
+ # back by the database due to a serialization failure or a deadlock.
+ #
+ # See the following:
+ #
+ # * http://www.postgresql.org/docs/current/static/transaction-iso.html
+ # * https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html#error_er_lock_deadlock
+ class TransactionSerializationError < ActiveRecordError
+ end
+
# IrreversibleOrderError is raised when a relation's order is too complex for
# +reverse_order+ to automatically reverse.
class IrreversibleOrderError < ActiveRecordError