Exception: ActiveRecord::TransactionRollbackError
- Inherits:
-
StatementInvalid
- Object
- StandardError
- ActiveRecordError
- AdapterError
- StatementInvalid
- ActiveRecord::TransactionRollbackError
- 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
Instance Attribute Summary
Attributes inherited from StatementInvalid
Attributes inherited from AdapterError
Method Summary
Methods inherited from StatementInvalid
Methods inherited from AdapterError
Constructor Details
This class inherits a constructor from ActiveRecord::StatementInvalid