Question about persistent DB connection, the LAST_INSERT_ID

From: Date: Wed, 17 Jan 2007 00:17:13 +0000
Subject: Question about persistent DB connection, the LAST_INSERT_ID
Groups: php.db 
Request: Send a blank email to php-db+get-42952@lists.php.net to get a copy of this message
HI, the question is whether there is any chance the LAST_INSERT_ID could be wrong during inserting with a persistent DB connection? For example, instance [AA] of a script insert one row with an auto-increment field, and retrieve the LAST_INSERT_ID after the operation, at the same time, there is another instance [BB] of the same script doing the same thing. Giving that the sequence happens as indicated below for reason that [AA] somehow runs a little slower after inserting. [AA] insert [BB] insert [BB] select the LAST_INSERT_ID (IDB) [AA] select the LAST_INSERT_ID (IDA) Will the [AA] still have the correct LAST_INSERT_ID when the DB connection is a persistent one? Thanks for help. -- If you have a minute, please visit http://www.cchere.com

« previous php.db (#42952) next »