On 01/10/2025 15:45, AllenJB wrote:
As an aside, the manual is unclear on how much management of
persistent connections PDO does. I have an open issue on this:
https://github.com/php/doc-en/issues/4540
(I did have a brief look again and based on some further investigation
I did based (initially) on the answer thecotne gave in the above
linked issue, believe that answer may not be accurate, at least in its
reasoning, and thus their conclusion is circumspect. Looking at this
again is somewhere on my todo list, I think)
An update: Based on testing, PDO (MySQL) does not perform cleanup of
state of persistent connections - this means transactions, temporary
tables, locks and other stateful changes may remain, causing the
connection to be in an unexpected state.
For details of my test see
https://github.com/php/doc-en/issues/4540#issuecomment-3368381887
In my opinion, this makes a method of forcing a (persistent) connection
closed explicitly useful.