What happens if I commit a pdo transaction where one or more entries are duplicates of already existing primary keys? Will the transaction insert all of the none duplicates or roll back?
If it is the latter, how can I prevent the rollback?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You won’t be able to commit such transaction, because you won’t be able to insert such rows in the first place.
See below
In MySQL console #1 we do this:
Then in console #2 we try:
The prompt will not return here and the session will hang for a while until…