mysql_insert_id + mysql_pconnect = race condition??
| From: | Marc Swanson | Date: | Wed, 21 Nov 2001 08:18:55 +0000 |
| Subject: | mysql_insert_id + mysql_pconnect = race condition?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-75364@lists.php.net to get a copy of this message | ||
In my code I have a few places where I use mysql_pconnect to open a
persistant database connection to mysql in order to reduce overhead. I also
use mysql_insert_id to fetch insert ids for various insert commands.
Since mysql_pconnect uses the SAME database connection between my php
scripts... is it concievable that a call to mysql_insert_id COULD return the
id of another insert call if one is happening at that exact moment? Or am I
worrying about nothing? If this IS a problem I'll be sure to change my code
to open a new database connection before calling mysql_insert_id.
Thanks!
--
-------------------------
Marc Swanson
MSwanson Consulting
Phone: (603)868-1721
Fax: (603)868-1730
Mobile: (603)512-1267
mswanson@mswanson.com
http://www.mswanson.com
-------------------------