Skip to main content

Posts

Showing posts with the label serializable

MySQL Transaction Isolation Level

Transaction Isolation Levels: Isolation level can be change for a single session or for all subsequent connections with the SET TRANSACTION statement. To set the server's default isolation level for all connections, use the --transaction-isolation option on the command line or in an option file. Each isolation level has different locking strategies. 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. READ COMMITT ED : First UPDATE acquires an x-lock on each row that it reads and releases those for rows that it does not modify. Each consistent read, even within the same transaction, sets and reads its own fresh snapshot. If you use READ COMMITTED , you must use row-based binary logging . REPEATABLE READ : Default for InnoDB - the first UPDATE acquires an x-lock on each row that it reads and do...