Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Inserting into mysql and getting inserted id at the same time

by Anonymous Monk
on Mar 25, 2021 at 14:13 UTC ( #11130325=note: print w/replies, xml ) Need Help??


in reply to Inserting into mysql and getting inserted id at the same time

The SQL server will always serialize the incoming requests they never literally occur "at the same time." Follow the advice already given to create a statement handle and retrieve the id. Also: if you need to perform a series of SQL statements without the possibility of interference, use explicit SQL "transactions." You begin the transaction, issue your statements, then "commit" to cause all of them to take effect at once.
  • Comment on Re: Inserting into mysql and getting inserted id at the same time

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11130325]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2021-05-07 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (90 votes). Check out past polls.

    Notices?