Skip to content

Make close() idempotent for already-closed connections#1044

Merged
bimalkjha merged 1 commit intoibmdb:masterfrom
ManitoulinTransport:idempotent-close-method
Feb 19, 2026
Merged

Make close() idempotent for already-closed connections#1044
bimalkjha merged 1 commit intoibmdb:masterfrom
ManitoulinTransport:idempotent-close-method

Conversation

@zenflow
Copy link
Contributor

@zenflow zenflow commented Feb 17, 2026

Return True when ibm_db.close() or ibm_db_dbi.Connection.close() is called on an already-closed connection instead of raising.
Add a DBI regression test for double-close behavior.

Closes #1042


The new test passes, but I was unable to run the whole test suite to check for regressions, as I'm not able to create an isolated database instance.
Can someone run the whole test suite and confirm all pass?

@zenflow
Copy link
Contributor Author

zenflow commented Feb 17, 2026

@Earammak Please let me know if I should do anything for this failing DCO check

@zenflow zenflow force-pushed the idempotent-close-method branch from 14f2ce7 to 45f5496 Compare February 18, 2026 06:58
Return True when ibm_db.close() or ibm_db_dbi.Connection.close() is called on an already-closed connection instead of raising.
Add a DBI regression test for double-close behavior.
@zenflow zenflow force-pushed the idempotent-close-method branch from 45f5496 to 86fd270 Compare February 18, 2026 06:59
@zenflow
Copy link
Contributor Author

zenflow commented Feb 18, 2026

Sorry for the force push.
I noticed a silly mistake (committed changes I made just for debugging) and wanted to keep the commit log clean.
The diff can be seen here: https://github.com/ibmdb/python-ibmdb/compare/14f2ce79496a2181a79cd63a94f54fcd12ce369e..86fd270f214cb262cb38c7b2a0b592b8c3e9e4bb
(It is just reversing changes that I should not have committed)

@bimalkjha bimalkjha merged commit 8473d58 into ibmdb:master Feb 19, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request (to avoid bugs) - Idempotent .close() method

2 participants

Comments