Oracle 5.0 Reference Manual page 1140

Table of Contents

Advertisement

• With the
GLOBAL
sessions. Existing sessions are unaffected.
• With the
SESSION
transactions performed within the current session.
• Without any
started) transaction performed within the current session.
A change to the global default isolation level requires the
change its session isolation level (even in the middle of a transaction), or the isolation level for its next
transaction.
To set the global default isolation level at server startup, use the
isolation=level
of
for this option use dashes rather than spaces, so the permissible values are
level
READ-UNCOMMITTED
SERIALIZABLE
use these lines in the
[mysqld]
transaction-isolation = REPEATABLE-READ
It is possible to check or set the global and session transaction isolation levels at runtime by using the
tx_isolation
SELECT @@GLOBAL.tx_isolation, @@tx_isolation;
SET GLOBAL tx_isolation='REPEATABLE-READ';
SET SESSION tx_isolation='SERIALIZABLE';
Details and Usage of Isolation Levels
supports each of the transaction isolation levels described here using different locking
InnoDB
strategies. You can enforce a high degree of consistency with the default
level, for operations on crucial data where ACID compliance is important. Or you can relax the
consistency rules with
such as bulk reporting where precise consistency and repeatable results are less important than
minimizing the amount of overhead for locking.
than
REPEATABLE READ
transactions and for troubleshooting issues with concurrency and deadlocks.
For full information about how these isolation levels work with
Section 14.2.7, "The
about
InnoDB
Section 14.2.7.4,
Different SQL Statements in
The following list describes how MySQL supports the different transaction levels. The list goes from the
most commonly used level to the least used.
REPEATABLE READ
This is the default isolation level for InnoDB. For consistent reads, there is an important difference
from the
READ COMMITTED
read the snapshot established by the first read. This convention means that if you issue several
plain (nonlocking)
consistent also with respect to each other. See
For locking reads
statements, locking depends on whether the statement uses a unique index with a unique search
condition, or a range-type search condition. For a unique index with a unique search condition,
locks only the index record found, not the gap before it. For other search conditions,
InnoDB
SET TRANSACTION
keyword, the statement sets the default transaction level globally for all subsequent
keyword, the statement sets the default transaction level for all subsequent
or
keyword, the statement sets the isolation level for the next (not
SESSION
GLOBAL
[423]
option to
mysqld
[1121],
READ-COMMITTED
[1121]. For example, to set the default isolation level to
section of an option file:
[mysqld]
[504]
system variable:
READ COMMITTED
[1120], and is used mainly in specialized situations, such as with XA
Transaction Model and
InnoDB
record-level locks and how it uses them to execute various types of statements, see
"InnoDB
Record, Gap, and Next-Key Locks"
InnoDB".
[1121]
statements within the same transaction, these
SELECT
(SELECT
with
FOR UPDATE
Syntax
SUPER
on the command line or in an option file. Values
[1121],
REPEATABLE-READ
[1121]
or even
READ UNCOMMITTED
SERIALIZABLE
Locking". In particular, for additional information
isolation level: All consistent reads within the same transaction
Section 14.2.7.2, "Consistent Nonlocking
or
LOCK IN SHARE
1120
[578]
privilege. Any session is free to
--transaction-
[1120], or
REPEATABLE READ
REPEATABLE READ
[1121], in situations
[1121]
enforces even stricter rules
transactions, see
InnoDB
and
Section 14.2.7.6, "Locks Set by
SELECT
MODE), UPDATE, and
[1120],
[1120]
statements are
Reads".
DELETE

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents