Shilline, ----- Original Message ----- From: "Shilline Lee" <[EMAIL PROTECTED]> To: ""Heikki Tuuri"" <[EMAIL PROTECTED]> Sent: Monday, October 14, 2002 4:08 AM Subject: Re: ROW LEVEL Locking not affected
> > > And then ? please tell me the detail :) > if I "SET AUTOCOMMIT = 0" in the session of user A > then when should I "COMMIT" in the session of user A > > coz I put the shared data in the table "test" and let many programs deal with these data, > so I just want to lock some rows selected by user A till I have them deleted or updated. > user B should not see these rows after the exclusive select of user A. how can I do ? > please address these general questions to the General MySQL Mailing List. You should commit A when his atomic work is ready. If B should not see the rows locked by A, then also B should use a locking read. A plain consistent reads an old snapshot of rows and is not blocked by any locks. Regards, Heikki > ----- Original Message ----- > From: ""Heikki Tuuri"" <[EMAIL PROTECTED]> > Newsgroups: mailing.database.mysql > Sent: Monday, October 14, 2002 2:23 AM > Subject: Re: ROW LEVEL Locking not affected > > > > Shilline, > > > > ----- Original Message ----- > > From: "Shilline Lee" <[EMAIL PROTECTED]> > > Newsgroups: mailing.database.mysql > > Sent: Sunday, October 13, 2002 7:16 AM > > Subject: ROW LEVEL Locking not affected > > > > > > > > > > Hello all: > > > > > > I did a row level lock with my database ( MySQL-4.0.3-beta with > > InnoDB ) > > > but it seems that it's not affected. > > > I have tried "FOR UPDATE" and "LOCK IN SHARE MODE", the lock seems not > > > affected, > > > why ? thanks in advanced ! > > > > did you remember to > > > > SET AUTOCOMMIT = 0 > > > > in the session of user A? > > > > Best regards, > > > > Heikki Tuuri > > Innobase Oy > > --- > > InnoDB - transactions, hot backup, and foreign key support for MySQL > > See http://www.innodb.com, download MySQL-Max from http://www.mysql.com > > > > > > sql query > > > > > User A: > > > > > > SELECT * FROM test FOR UPDATE; > > > +---+---+ > > > | 1 | 2 | > > > +---+---+ > > > | 1 | 2 | > > > +---+---+ > > > 1 row in set (0.00 sec) > > > > > > User B: > > > mysql> SELECT * FROM test; > > > > > > +---+---+ > > > | 1 | 2 | > > > +---+---+ > > > | 1 | 2 | > > > +---+---+ > > > 1 row in set (0.00 sec) > > > > > > mysql> delete from submit; > > > Query OK, 1 row affected (0.01 sec) > > > > > > User A: > > > > > > mysql> SELECT * FROM test; > > > Empty set (0.00 sec) > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > Before posting, please check: > > http://www.mysql.com/manual.php (the manual) > > http://lists.mysql.com/ (the list archive) > > > > To request this thread, e-mail <[EMAIL PROTECTED]> > > To unsubscribe, e-mail <[EMAIL PROTECTED]> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php