Hi.

On Sun 2002-12-08 at 14:50:35 +0200, [EMAIL PROTECTED] wrote:
[...]
> >   SELECT *
> >   FROM your_table
> >   WHERE <some-condition-for-the-row-in-question>
> >   FOR UPDATE
[...]
> I would like to clarify that InnoDB holds locks till the current transaction
> COMMIT or ROLLBACK. Thus, in the AUTOCOMMIT=1 mode is makes no sense to use
> FOR UPDATE.

Thanks. I was not aware, that FOR UPDATE works this way.

Then I have another question: Why would one use FOR UPDATE with
BEGIN/COMMIT? I thought, in the default transaction seperatation level
for InnoDB, REPEATED READ, I am guaranteed that nobody changed the
rows anyway. Correct?

So the only advantage would be, that in a long transaction I have
already locked them early and cannot be rolled back later due to a
deadlock. (Well, and this behaviour has changed in recent 4.0, IIRC).

Does this mean, FOR UPDATE is mostly useful with lesser transaction
seperation levels?

TIA,

        Benjamin.

-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
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

Reply via email to