note 127219 added to pdo.transactions
| From: | hooby404 at gmail dot com | Date: | Tue, 05 Jul 2022 08:08:32 +0000 |
| Subject: | note 127219 added to pdo.transactions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-218895@lists.php.net to get a copy of this message | ||
> You're not limited to making updates in a transaction; you can also issue complex
> queries to extract data, and possibly use that information to build up more updates
> and queries; while the transaction is active, you are guaranteed that no one else can
> make changes while you are in the middle of your work. For further reading on
> transactions, refer to the documentation provided by your database server.
This only holds true if you specifically do "SELECT .... FOR UPDATE".
Without the "FOR UPDATE" part, when two transactions run at the same time, the second
transaction could change a value AFTER the first transaction read it, but BEFORE the first
transaction used it for updates.
Without the "FOR UPDATE" part you are absolutely NOT GUARANTEED that no one else can make
changes while you are in the middle of your work.
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.133 (proxied: 91.113.149.10)
----
Manual Page -- https://php.net/manual/en/pdo.transactions.php
Edit -- https://main.php.net/note/edit/127219
Del: integrated -- https://main.php.net/note/delete/127219/integrated
Del: useless -- https://main.php.net/note/delete/127219/useless
Del: bad code -- https://main.php.net/note/delete/127219/bad+code
Del: spam -- https://main.php.net/note/delete/127219/spam
Del: non-english -- https://main.php.net/note/delete/127219/non-english
Del: in docs -- https://main.php.net/note/delete/127219/in+docs
Del: other reasons-- https://main.php.net/note/delete/127219
Reject -- https://main.php.net/note/reject/127219
Search -- https://main.php.net/manage/user-notes.php