Use local variable instead of instance variable for storing select statement when in prepare mode
Q
A
Documentation
no
Bugfix
yes
BC Break
no
New Feature
no
RFC
no
QA
no
Description
Found the issue while running integration tests using the database adapter. If in the same method you fetch something from database using \Laminas\Db\Adapter\Adapter::query in prepare mode and after use the table gateway to fetch something from the database, a reference to the PDO connection remains and is not released when trying to disconnect from the database.
Added a test case with the scenario with many tests in the data provider. On the tearDown I have disconnected from the database.
Use local variable instead of instance variable for storing select statement when in prepare mode
Description
Found the issue while running integration tests using the database adapter. If in the same method you fetch something from database using
\Laminas\Db\Adapter\Adapter::query
in prepare mode and after use the table gateway to fetch something from the database, a reference to the PDO connection remains and is not released when trying to disconnect from the database.Added a test case with the scenario with many tests in the data provider. On the tearDown I have disconnected from the database.