Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with connection not released in specific scenario #292

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

ionutf6s
Copy link
Contributor

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.

src/Adapter/Adapter.php Show resolved Hide resolved
src/Adapter/Adapter.php Outdated Show resolved Hide resolved
…atement when in prepare mode

Signed-off-by: Ionut Codreanu <ionut@f6s.com>
…r\Adapter

Signed-off-by: Ionut Codreanu <ionut@f6s.com>
…rk it as deprecated

Signed-off-by: Ionut Codreanu <ionut@f6s.com>
@Xerkus Xerkus force-pushed the database_connection_not_released branch from 5f43b63 to e725a60 Compare February 1, 2024 17:31
@Xerkus Xerkus added this to the 2.19.0 milestone Feb 1, 2024
@Xerkus Xerkus added the Bug Something isn't working label Feb 1, 2024
@Xerkus Xerkus requested a review from Ocramius February 1, 2024 17:32
@Xerkus Xerkus merged commit 5d8c89d into laminas:2.19.x Feb 1, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants