Exception: ActiveRecord::TransactionRollbackError

Inherits:
StatementInvalid show all
Defined in:
lib/active_record/errors.rb

Overview

TransactionRollbackError will be raised when a transaction is rolled back by the database due to a serialization failure or a deadlock.

These exceptions should not be generally rescued in nested transaction blocks, because they have side-effects in the actual enclosing transaction and internal Active Record state. They can be rescued if you are above the root transaction block, though.

In that case, beware of transactional tests, however, because they run test cases in their own umbrella transaction. If you absolutely need to handle these exceptions in tests please consider disabling transactional tests in the affected test class (self.use_transactional_tests = false).

Due to the aforementioned side-effects, this exception should not be raised manually by users.

See the following:

Direct Known Subclasses

Deadlocked, SerializationFailure

Instance Attribute Summary

Attributes inherited from StatementInvalid

#binds, #sql

Attributes inherited from AdapterError

#connection_pool

Method Summary

Methods inherited from StatementInvalid

#initialize, #set_query

Methods inherited from AdapterError

#initialize

Constructor Details

This class inherits a constructor from ActiveRecord::StatementInvalid