I do not understand the meaning of the word "atomic". For example:
$conn = $this->ArticlesTable->connection();
$articles->save($entity, ['atomic' => false]); // <-- here
$conn->commit();
Should it not be be "autocommit" instead?
You're actually turning on/off "atomic" transactions, not "automatic" transactions.
"Atomic" is the correct term:
An atomic transaction is an indivisible and irreducible series of database operations such that either all occur, or nothing occurs. A guarantee of atomicity prevents updates to the database occurring only partially, which can cause greater problems than rejecting the whole series outright.
-Wikipedia: Atomicity
The key there is "...such that either ALL occur, or NOTHING occurs."
When atomic is false
(off), and you run a save that requires more than one query, it will run each individually and could be successful on some, but not others.
When atomic is true
(on), and you run a save that requires more than one query, it will process them as a single transaction, and either complete all successfully or fail all completely. No partial saves/updates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With