diff options
| author | Tim Graham <timograham@gmail.com> | 2017-01-17 11:16:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-17 11:16:15 -0500 |
| commit | f01ad1cb6a27669fd44b2079089e14f9dc4d3ca3 (patch) | |
| tree | ba35dc08d5d474e7b14682ff34863deb67cb5e43 /docs | |
| parent | 46e0335583661507f1c10adb97fbd9dcfbb9b787 (diff) | |
Refs #27683 -- Allowed setting isolation level in DATABASES ['OPTIONS'] on MySQL.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/databases.txt | 26 | ||||
| -rw-r--r-- | docs/releases/1.11.txt | 5 |
2 files changed, 31 insertions, 0 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 16addc52bc..0c2465a9af 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -492,6 +492,32 @@ like other MySQL options: either in a config file or with the entry ``'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"`` in the :setting:`OPTIONS` part of your database configuration in :setting:`DATABASES`. +.. _mysql-isolation-level: + +Isolation level +~~~~~~~~~~~~~~~ + +.. versionadded:: 1.11 + +When running concurrent loads, database transactions from different sessions +(say, separate threads handling different requests) may interact with each +other. These interactions are affected by each session's `transaction isolation +level`_. You can set a connection's isolation level with an +``'isolation_level'`` entry in the :setting:`OPTIONS` part of your database +configuration in :setting:`DATABASES`. Valid values for +this entry are the four standard isolation levels: + +* ``'read uncommitted'`` +* ``'read committed'`` +* ``'repeatable read'`` +* ``'serializable'`` + +or ``None`` to use the server's configured isolation level. However, Django +works best with read committed rather than MySQL's default, repeatable read. +Data loss is possible with repeatable read. + +.. _transaction isolation level: https://dev.mysql.com/doc/refman/en/innodb-transaction-isolation-levels.html + Creating your tables -------------------- diff --git a/docs/releases/1.11.txt b/docs/releases/1.11.txt index 08572560ea..1546b68832 100644 --- a/docs/releases/1.11.txt +++ b/docs/releases/1.11.txt @@ -255,6 +255,11 @@ Database backends the worker memory load (used to hold query results) to the database and might increase database memory usage. +* Added MySQL support for the ``'isolation_level'`` option in + :setting:`OPTIONS` to allow specifying the :ref:`transaction isolation level + <mysql-isolation-level>`. To avoid possible data loss, it's recommended to + switch from MySQL's default level, repeatable read, to read committed. + Email ~~~~~ |
