Anand Buddhdev <[EMAIL PROTECTED]> wrote on 27/02/2004 11:26:41:


> The problem with first doing a select, and then an insert, is that
> there exists a race condition. Between the select and insert, someone
> else could insert a row which might cause a duplication.
>
> I have another solution, in which I use a transaction to avoid this
> problem. But this means I have to change to mysql 4 or postgresql.
> Fedora core is still shipping mysql 3.23.58 :(


You could also lock the table manually, which is supported by MySQL 3.xx
See
http://www.mysql.com/doc/en/LOCK_TABLES.html

      Alec


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to