8000 Dont lock tables or start transactions · symfony/symfony@26061a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 26061a1

Browse files
committed
Dont lock tables or start transactions
1 parent f72d516 commit 26061a1

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/PostgreSqlConnectionTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,10 @@ public function testGetExtraSetupSql()
5151
$table->addOption('_symfony_messenger_table_name', 'queue_table');
5252
$sql = implode("\n", $connection->getExtraSetupSqlForTable($table));
5353

54-
/*
55-
* We need to start a transaction for the following commands to work properly:
56-
* doctrine:schema:create
57-
* messenger:setup-transports
58-
* doctrine:migrations:diff and doctrine:migrations:migrate
59-
*/
60-
$this->assertStringContainsString('BEGIN;', $sql);
6154
$this->assertStringContainsString('CREATE TRIGGER', $sql);
6255

63-
// We MUST NOT commit, that will mess with the PDO in PHP 8
56+
// We MUST NOT use transaction, that will mess with the PDO in PHP 8
57+
$this->assertStringNotContainsString('BEGIN;', $sql);
6458
$this->assertStringNotContainsString('COMMIT;', $sql);
6559
}
6660

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ public function getExtraSetupSqlForTable(Table $createdTable): array
109109
private function getTriggerSql(): array
110110
{
111111
return [
112-
'BEGIN;',
113-
sprintf('LOCK TABLE %s;', $this->configuration['table_name']),
114112
// create trigger function
115113
sprintf(<<<'SQL'
116114
CREATE OR REPLACE FUNCTION notify_%1$s() RETURNS TRIGGER AS $$

0 commit comments

Comments
 (0)
0