A programmer just asked me about a possible race condition,
and I didn't know what to answer:  

If I insert a line using autoincrement, then ask for last_insert_id()
am I guaranteed to get the same ID I just inserted?

It seems that another program could be inserting at almost the same
time, and could increment the counter again before my last_insert_id()
checks it.  In that case, I would not be dealing with the
same line I just inserted.

Does anyone know if this is a genuine concern?  If it is, can anyone
think of a workaround?

Thanks,
Steve





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

Reply via email to