From 9acb8f9191c4d2504fc6869b2c6f08119082d685 Mon Sep 17 00:00:00 2001 From: JargonMan Date: Wed, 8 Aug 2018 16:15:04 -0400 Subject: [PATCH] Updated disconnect for persistent connections The db2_pconnect allows persistent connections to be made in the connect function, but the the db2_close function in the disconnect function does not close those connections. This change allows a boolean to be passed to the disconnect function with a value of true that will allow a persistent connection to be closed. --- src/Adapter/Driver/IbmDb2/Connection.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Adapter/Driver/IbmDb2/Connection.php b/src/Adapter/Driver/IbmDb2/Connection.php index 8c7a68bd51..46d11b147e 100644 --- a/src/Adapter/Driver/IbmDb2/Connection.php +++ b/src/Adapter/Driver/IbmDb2/Connection.php @@ -146,10 +146,14 @@ public function isConnected() /** * {@inheritDoc} */ - public function disconnect() + public function disconnect($isPersistent = false) { if ($this->resource) { - db2_close($this->resource); + if ($isPersistent = false) { + db2_close($this->resource); + } else { + db2_pclose($this->resource); + } $this->resource = null; }