List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:January 17 2001 1:11am
Subject:Re: Foreign Key Info error in manual
View as plain text  
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
	dnelson@stripped
Thread
Foreign Key Info error in manualScott Gerhardt17 Jan
  • Re: Foreign Key Info error in manualDan Nelson17 Jan
    • RE: Foreign Key Info error in manualScott Gerhardt17 Jan
      • Re: Foreign Key Info error in manualJeremy D. Zawodny17 Jan
        • RE: Foreign Key Info error in manualScott Gerhardt17 Jan
          • Re: Foreign Key Info error in manualJeremy D. Zawodny17 Jan
      • Re: Foreign Key Info error in manualPaul DuBois17 Jan
        • RE: Foreign Key Info error in manualScott Gerhardt17 Jan
      • Re: Foreign Key Info error in manualBenjamin Pflugmann17 Jan
        • RE: Foreign Key Info error in manualScott Gerhardt17 Jan
  • Re: Foreign Key Info error in manualJeremy D. Zawodny17 Jan