Avatar of renisenbb
renisenbb
 asked on

SQL: Want to update multiple rows, but roll back if any of the updates fails.

Let's say i want to do 3 updates. The second update is not valid(the key doesn't exist in the db).
So i want to roll back all 3 updates.
connection.setAutoCommit(false);
3 updates
connection.commit()


Will that work
MySQL Server

Avatar of undefined
Last Comment
Walter Ritzel

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Walter Ritzel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23