Skip to content

Commit 9f43121

Browse files
committed
bug #43630 [Messenger] Fix unwrapping the Postgres connection in DBAL 3 (derrabus)
This PR was merged into the 5.3 branch. Discussion ---------- [Messenger] Fix unwrapping the Postgres connection in DBAL 3 | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #43601 | License | MIT | Doc PR | N/A Commits ------- 95d5790 [Messenger] Fix unwrapping the Postgres connection in DBAL 3
2 parents 8db1f98 + 95d5790 commit 9f43121

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport;
1313

14+
use Doctrine\DBAL\Driver\PDO\Connection as DoctrinePdoConnection;
1415
use Doctrine\DBAL\Schema\Table;
1516

1617
/**
@@ -72,7 +73,12 @@ public function get(): ?array
7273
$this->listening = true;
7374
}
7475

75-
$notification = $this->driverConnection->getWrappedConnection()->pgsqlGetNotify(\PDO::FETCH_ASSOC, $this->configuration['get_notify_timeout']);
76+
$wrappedConnection = $this->driverConnection->getWrappedConnection();
77+
if (!$wrappedConnection instanceof \PDO && $wrappedConnection instanceof DoctrinePdoConnection) {
78+
$wrappedConnection = $wrappedConnection->getWrappedConnection();
79+
}
80+
81+
$notification = $wrappedConnection->pgsqlGetNotify(\PDO::FETCH_ASSOC, $this->configuration['get_notify_timeout']);
7682
if (
7783
// no notifications, or for another table or queue
7884
(false === $notification || $notification['message'] !== $this->configuration['table_name'] || $notification['payload'] !== $this->configuration['queue_name']) &&

0 commit comments

Comments
 (0)