So referential integrity is maintained but AUTO_INCREMENT values may not be
chronological?

Connection A's LAST_INSERT_ID() may be 3 at 15:20
AND
Connection B's LAST_INSERT_ID() may be 4 at 15:18

        - Scott


> In the last episode (Jan 16), Scott Gerhardt said:
> > I was reading the information on foreign keys in the manual
> > http://www.mysql.com/doc/e/x/example-Foreign_keys.html
> > and noticed that there is no mention of locking the tables.
> >
> > It seems to me that using the example verbatim could lead to loss of
> > referencial integrity if INSERTS did not occur in sequence (i.e. another
> > person was inserted before shirts).
> >
> > Using "LAST_INSERT_ID()" can only be guranteed to work if the tables are
> > locked.
>
> >From the manual section on LAST_INSERT_ID():
>
>      The last ID that was generated is maintained in the server on a
>      per-connection basis.  It will not be changed by another client.
>
>
> --
>       Dan Nelson
>       [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