troubleshooting Question

Persistent Connections & LAST_INSERT_ID (LAMP)

Avatar of BrianPap22
BrianPap22 asked on
PHPMySQL Server
3 Comments1 Solution383 ViewsLast Modified:
MySQL 5.0.27
PHP 5.2.0
Apache 2.0.59

I'm running a LAMP server and am thinking of testing out persistent connections to improve performance during peak load (several hundred users per minute). The issue is that there are several different pages in my website that insert a record to an auto_increment table, then next issue a simple "SELECT LAST_INSERT_ID()" query.  When using persistent connections, do I ever have to worry about one user getting the last_insert_id of another user in a race situation?  Is there certain coding I need to do in my PHP code to avoid this?

I've received conflicting answers to this question, so I would appreciate a little more than a simple Yes/No answer.

Thank you,
-Brian
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros