1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

7 commits

Author SHA1 Message Date
José Valim
ec11807368 Deprecate use of string in establish_connection as connection lookup 2013-12-24 10:18:54 +01:00
Rafael Mendonça França
bd09afb5fb Don't skip tests if we don't need to.
We can conditional define the tests depending on the adapter or
connection.

Lets keep the skip for fail tests that need to be fixed.
2013-11-08 13:59:07 -02:00
Amparo Luna + Guillermo Iguaran
1f3a1fedf9 Rename update_attributes method to update, keep update_attributes as an alias 2013-01-03 11:51:21 -05:00
Yasuo Honda
5826b5008f Skip tests for non-supported isolation levels
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.
2012-09-26 04:29:25 +09:00
Yasuo Honda
5f1710b187 Skip tests for non-supported isolation levels with Oracle 2012-09-25 23:42:54 +09:00
Jon Leighton
f74ddc8a4c Make the serializable test much looser
It's too hard to test this properly, so let's just check that there are
no errors.
2012-09-21 17:56:04 +01:00
Jon Leighton
392eeecc11 Support for specifying transaction isolation level
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.
2012-09-21 16:32:27 +01:00