aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/transaction_isolation_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Rename update_attributes method to update, keep update_attributes as an aliasAmparo Luna + Guillermo Iguaran2013-01-031-1/+1
|
* Skip tests for non-supported isolation levelsYasuo Honda2012-09-261-2/+6
| | | | | | | | i.e. Oracle database does not support these isolation levels. `:read_uncommitted` `:repeatable_read` This commit also works with other databases which do not support these isolation levels.
* Skip tests for non-supported isolation levels with OracleYasuo Honda2012-09-251-0/+2
|
* Make the serializable test much looserJon Leighton2012-09-211-18/+5
| | | | | It's too hard to test this properly, so let's just check that there are no errors.
* Support for specifying transaction isolation levelJon Leighton2012-09-211-0/+121
If your database supports setting the isolation level for a transaction, you can set it like so: Post.transaction(isolation: :serializable) do # ... end Valid isolation levels are: * `:read_uncommitted` * `:read_committed` * `:repeatable_read` * `:serializable` You should consult the documentation for your database to understand the semantics of these different levels: * http://www.postgresql.org/docs/9.1/static/transaction-iso.html * https://dev.mysql.com/doc/refman/5.0/en/set-transaction.html An `ActiveRecord::TransactionIsolationError` will be raised if: * The adapter does not support setting the isolation level * You are joining an existing open transaction * You are creating a nested (savepoint) transaction The mysql, mysql2 and postgresql adapters support setting the transaction isolation level. However, support is disabled for mysql versions below 5, because they are affected by a bug (http://bugs.mysql.com/bug.php?id=39170) which means the isolation level gets persisted outside the transaction.