From 40607ecfc2f5158200bd985be369afe27d8841cb Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sat, 4 Oct 2025 17:18:11 +0100 Subject: [PATCH 1/7] PDO: Add warning about (lack of) persistent connection cleanup (based on https://github.com/php/doc-en/issues/4540 ) --- reference/pdo/connections.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/pdo/connections.xml b/reference/pdo/connections.xml index dae512b9fce3..2b709b6068b7 100644 --- a/reference/pdo/connections.xml +++ b/reference/pdo/connections.xml @@ -130,6 +130,12 @@ $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass, array( object, the driver will not use persistent connections. + + + PDO does not perform any cleanup of persistent connections. Temporary tables, locks, transactions and other stateful + changes may remain from previous usage of the connection, causing unexpected problems. + + If you're using the PDO ODBC driver and your ODBC libraries support ODBC From b98124ddee337ac18d48b0afa66f8bd54449a2e9 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sun, 5 Oct 2025 10:01:41 +0100 Subject: [PATCH 2/7] PDO persistent connection warning: Add link to Persistent DB Connections page --- reference/pdo/connections.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/pdo/connections.xml b/reference/pdo/connections.xml index 2b709b6068b7..8b9291a65d58 100644 --- a/reference/pdo/connections.xml +++ b/reference/pdo/connections.xml @@ -133,7 +133,8 @@ $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass, array( PDO does not perform any cleanup of persistent connections. Temporary tables, locks, transactions and other stateful - changes may remain from previous usage of the connection, causing unexpected problems. + changes may remain from previous usage of the connection, causing unexpected problems. See the + Persistent Database Connections section for more information. From f14fd51e19e86890932a7ba0823a2151c8a5fc92 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sun, 5 Oct 2025 10:39:00 +0100 Subject: [PATCH 3/7] Persistent connections: Add links to relevant mysqli and PDO pages --- features/persistent-connections.xml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/features/persistent-connections.xml b/features/persistent-connections.xml index b6577d276017..c115670607df 100644 --- a/features/persistent-connections.xml +++ b/features/persistent-connections.xml @@ -121,11 +121,21 @@ probably will) change the efficiency of the script, but not its behavior! - - See also ibase_pconnect, ociplogon, - odbc_pconnect, oci_pconnect, - pfsockopen, and pg_pconnect. - + + &reftitle.seealso; + + + ibase_pconnect + ociplogon + odbc_pconnect + oci_pconnect + pfsockopen + pg_connect + MySQLi and Persistent Connections + PDO Connection Management + + +