Skip to content

Transaction and Lock

Begin Transaction

BEGIN

START TRANSACTION [READ WRITE | READ ONLY]

Note

Will commit any existing open transaction

Commit Transaction

COMMIT

Rollback Transaction

ROLLBACK

Lock Tables

-- TBD
LOCK {TABLE | TABLES} tbl_name { READ | WRITE } [, tbl_name { READ | WRITE }] ...

Note

This command must be executed after BEGIN transaction for performance or prevent other sessions to , and locks will be released after commit transaction.

Set Isolation Level

-- TBD
SET TRANSACTION ISOLATION LEVEL { READ COMMITTED | REPEATABLE READ | READ UNCOMMITTED | SERIALIZABLE }

Note

TBD, default is READ COMMITTED.

Set Auto Commit

SET AUTOCOMMIT = {0 | 1}

Note

Default AUTOCOMMIT = 1.

Comments