From 6bba2a5002a9ec26f9633aa1d7a47c3d9054c387 Mon Sep 17 00:00:00 2001 From: David Martos Date: Mon, 23 Dec 2024 17:32:17 +0100 Subject: [PATCH 1/2] Don't ignore close in the pool when using force --- CHANGELOG.md | 4 ++++ lib/src/pool/pool_impl.dart | 6 ++++-- pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f682700..03ea686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.4.8 + +- Fix: Don't ignore de pool resource `close` call when using foce. + ## 3.4.7 - Implemented `Pool.close(force: true)` (using [davidmartos96](https://github.com/davidmartos96)'s [#397](https://github.com/isoos/postgresql-dart/pull/397) as baseline). diff --git a/lib/src/pool/pool_impl.dart b/lib/src/pool/pool_impl.dart index 6ca7e77..d16a989 100644 --- a/lib/src/pool/pool_impl.dart +++ b/lib/src/pool/pool_impl.dart @@ -282,10 +282,12 @@ class _PoolConnection implements Connection { @override Future close({bool force = false}) async { - // Don't forward the close call, the underlying connection should be re-used + // Don't forward the close call unless forcing. The underlying connection should be re-used // when another pool connection is requested. - // TODO: Implement force close. + if (force) { + await _connection.close(force: force); + } } @override diff --git a/pubspec.yaml b/pubspec.yaml index e989df8..e8f4d38 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: postgres description: PostgreSQL database driver. Supports statement reuse and binary protocol and connection pooling. -version: 3.4.7 +version: 3.4.8 homepage: https://github.com/isoos/postgresql-dart topics: - sql From e3420a1a1b463b70d1f007208de2ba88e0210f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20So=C3=B3s?= Date: Thu, 26 Dec 2024 23:33:54 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03ea686..86f5723 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 3.4.8 -- Fix: Don't ignore de pool resource `close` call when using foce. +- Fix: Don't ignore de pool resource `close` call when using foce. [#406](https://github.com/isoos/postgresql-dart/pull/406) by [davidmartos96](https://github.com/davidmartos96). ## 3.4.7