Re: locking on row level ...

2002-06-21 Thread Heikki Tuuri
Michael, - Original Message - From: "Michael Bacarella" <[EMAIL PROTECTED]> To: "Heikki Tuuri" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> > > SELECT * FROM mytable WHERE mycol = xxx LOCK IN SHARE MODE; > > > > or > > > > SELECT * FROM mytable WHERE mycol = xxx FOR UPDATE; > > > > > > The

Re: locking on row level ...

2002-06-21 Thread Michael Bacarella
On Fri, Jun 21, 2002 at 12:38:06AM +0300, Heikki Tuuri wrote: > InnoDB type tables in MySQL have row level locking. Call SET AUTOCOMMIT=0 or > wrap your transaction in BEGIN ... COMMIT. > > Make sure you have an index on column 'mycol' so that InnoDB finds the row > without a table scan. Then you

Re: locking on row level ...

2002-06-21 Thread Tod Harter
On Thursday 20 June 2002 17:50, Cal Evans wrote: What you want to do is wrap the update in a transaction with transaction isolation level set to SERALIZABLE. This should insure that whichever client is first to initiate the transaction will have effectively exclusive access to the record in qu

RE: locking on row level ...

2002-06-20 Thread Cal Evans
Short answer: You don't. That's not the way SQL databases work. When you hear of 'row level locking' it means something different than you are used to if you are coming from Access/Foxpro. If you are using InnoDB tables then you can: BEGIN TRANS statement statement statement COMMIT or ROLL

Re: locking on row level ...

2002-06-20 Thread Heikki Tuuri
Hi! - Original Message - From: "Galen Wright-Watson" <[EMAIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Thursday, June 20, 2002 11:32 PM Subject: Re: locking on row level ... > > On Wed, 19 Jun 2002, Silmara Cristina Basso wrote: > > > I'm

Re: locking on row level ...

2002-06-20 Thread Galen Wright-Watson
On Wed, 19 Jun 2002, Silmara Cristina Basso wrote: > I'm newbie MySQL and I'm using MySQL-max 4.0.1(Innodb), with one application > developed in Delphi and connect through MyODBC. The question is ... > How can i do to lock one row so that it is editing in the application? > > The impression I g