XA Transactions
1121
InnoDB
locks the index range scanned, using gap locks or next-key (gap plus index-record) locks to
block insertions by other sessions into the gaps covered by the range.
•
READ COMMITTED
A somewhat Oracle-like isolation level with respect to consistent (nonlocking) reads: Each consistent
read, even within the same transaction, sets and reads its own fresh snapshot. See
Section 14.2.7.2,
“Consistent Nonlocking Reads”
.
For locking reads (
SELECT
with
FOR UPDATE
or
LOCK IN SHARE MODE
),
InnoDB
locks only index
records, not the gaps before them, and thus permits the free insertion of new records next to locked
records. For
UPDATE
and
DELETE
statements, locking depends on whether the statement uses a
unique index with a unique search condition (such as
WHERE id = 100
), or a range-type search
condition (such as
WHERE id > 100
). For a unique index with a unique search condition,
InnoDB
locks only the index record found, not the gap before it. For range-type searches,
InnoDB
locks the
index range scanned, using gap locks or next-key (gap plus index-record) locks to block insertions by
other sessions into the gaps covered by the range. This is necessary because “phantom rows” must
be blocked for MySQL replication and recovery to work.
•
READ UNCOMMITTED
SELECT
statements are performed in a nonlocking fashion, but a possible earlier version of a row
might be used. Thus, using this isolation level, such reads are not consistent. This is also called a
“dirty read.” Otherwise, this isolation level works like
READ COMMITTED
[1121]
.
•
SERIALIZABLE
This level is like
REPEATABLE READ
[1120]
, but
InnoDB
implicitly converts all plain
SELECT
statements to
SELECT ... LOCK IN SHARE MODE
if autocommit is disabled. If autocommit
is enabled, the
SELECT
is its own transaction. It therefore is known to be read only and can be
serialized if performed as a consistent (nonlocking) read and need not block for other transactions.
(To force a plain
SELECT
to block if other transactions have modified the selected rows, disable
autocommit.)
13.3.7. XA Transactions
MySQL 5.0.3 and up provides server-side support for XA transactions. Currently, this support is
available for the
InnoDB
storage engine. The MySQL XA implementation is based on the X/Open CAE
document Distributed Transaction Processing: The XA Specification. This document is published by
The Open Group and available at
http://www.opengroup.org/public/pubs/catalog/c193.htm
. Limitations
of the current XA implementation are described in
Section E.5, “Restrictions on XA Transactions”
.
On the client side, there are no special requirements. The XA interface to a MySQL server consists of
SQL statements that begin with the
XA
keyword. MySQL client programs must be able to send SQL
statements and to understand the semantics of the XA statement interface. They do not need be linked
against a recent client library. Older client libraries also will work.
Currently, among the MySQL Connectors, MySQL Connector/J 5.0.0 supports XA directly (by means of
a class interface that handles the Xan SQL statement interface for you).
XA supports distributed transactions; that is, the ability to permit multiple separate transactional
resources to participate in a global transaction. Transactional resources often are RDBMSs but may be
other kinds of resources.
A global transaction involves several actions that are transactional in themselves, but that all must
either complete successfully as a group, or all be rolled back as a group. In essence, this extends ACID
properties “up a level” so that multiple ACID transactions can be executed in concert as components of
a global operation that also has ACID properties. (However, for a distributed transaction, you must use
the
SERIALIZABLE
[1121]
isolation level to achieve ACID properties. It is enough to use
REPEATABLE
READ
[1120]
for a nondistributed transaction, but not for a distributed transaction.)
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...