List:General Discussion« Previous MessageNext Message »
From:Heikki Tuuri Date:March 4 2006 3:07pm
Subject:Re: Enforcing Isolation in MySQL database
View as plain text  
Vinay,

----- Original Message ----- 
From: ""Vinay"" <vinay@stripped>
Newsgroups: mailing.database.myodbc
Sent: Thursday, March 02, 2006 12:20 AM
Subject: Enforcing Isolation in MySQL database


> ------=_NextPart_000_002C_01C63D51.B51315D0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> Hello ,
>          I suppose the InnoDB tables in Mysql have REPEATABLE-READ as =
> the default isolation. Is the concurrency enforced automatically by the =
> database or is there anything=20
> the application programmer has to do to make sure the data consistent.
>
>
> How does the REPEATABLE-READ resolve the following scenario.
>
>
> User1 opens a application and reads a row on the screen.
> User2 opens the same application and read the same row on the screen.
>
>
> User2 updates a field (and commits ,as the autocommit is on),
> User1 still is reading the non-updated row , and updates the same field =
> updated by the User2 to different value.
>
>
> How does  it affect the database when normal select , update queries are =
> used.

you should use SELECT ... FOR UPDATE in this case. A normal plain SELECT in 
InnoDB does not lock the rows it reads.

> What should the application programmer to enforce database concurrency.
>
> Thank you,
> Vinay

Best regards,

Heikki

Oracle Corp./Innobase Oy
InnoDB - transactions, row level locking, and foreign keys for MySQL

InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM 
tables
http://www.innodb.com/order.php

Thread
Enforcing Isolation in MySQL databaseVinay1 Mar
Re: Enforcing Isolation in MySQL databaseHeikki Tuuri4 Mar