Search the MySQL manual:
MySQL Manual

Buy this Reference Manual in softcover from Barnes & Noble!

/ / Up / Table of Contents

6.7.3 Синтаксис команды SET TRANSACTION

SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
{ READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE }

Устанавливает уровень изоляции транзакций.

По умолчанию уровень изоляции устанавливается для последующей (не начальной) транзакции. При использовании ключевого слова GLOBAL данная команда устанавливает уровень изоляции по умолчанию глобально для всех новых соединений, созданных от этого момента. Однако для того чтобы выполнить данную команду, необходима привилегия SUPER. При использовании ключевого слова SESSION устанавливается уровень изоляции по умолчанию для всех будущих транзакций, выполняемых в текущем соединении.

Установить глобальный уровень изоляции по умолчанию для утилиты mysqld можно с помощью опции --transaction-isolation=.... See section 4.1.1 Параметры командной строки mysqld.

User Comments

Posted by on Tuesday September 24 2002, @10:36am [Delete] [Edit]

How about some details on the variants of this
command? What is the significance of READ
UNCOMMITTED, READ COMMITTED, REPEATABLE
READ and SERIALIZABLE?

Posted by [name withheld] on Sunday October 20 2002, @9:00am [Delete] [Edit]

What's the difference?

Posted by on Monday October 21 2002, @1:58pm [Delete] [Edit]

Not sure about MySQL's specifics on this one, but
here's what they should do:
READ UNCOMMITTED: queries within this transaction
type will be able to see all data, whether within
another transaction or not (often unsafe).
READ COMMITTED: queries within this transaction
type can only see data that has been committed;
uncommitted data in other transactions will be
invisible.
REPEATABLE READ: queries within this transaction
type will always get the same results; queries in
other transactions trying to change such data will
possibly block until the other transactions
'looking at' the same rows/tables are done.

Posted by on Tuesday November 12 2002, @9:11am [Delete] [Edit]

What's the default isolation transaction level,if not
set by this command neither with command line
option?.

Posted by Alex Soto on Friday January 31 2003, @4:12pm [Delete] [Edit]

"SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;"

Does not work in version 3.23.51

Posted by on Thursday February 20 2003, @10:14am [Delete] [Edit]

What do you mean it doesn't work in 3.23 ? the whole SET ISOLATION LEVEL feature has no use in this version?

What's SERIALIZABLE ? it wasn't answered in the previous comment...

Add your own comment.

Top / / / Up / Table of Contents