Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] Don't lock tables or start transactions #40376

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

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,10 @@ public function testGetExtraSetupSql()
$table->addOption('_symfony_messenger_table_name', 'queue_table');
$sql = implode("\n", $connection->getExtraSetupSqlForTable($table));

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ public function getExtraSetupSqlForTable(Table $createdTable): array
private function getTriggerSql(): array
{
return [
'BEGIN;',
sprintf('LOCK TABLE %s;', $this->configuration['table_name']),
// create trigger function
sprintf(<<<'SQL'
CREATE OR REPLACE FUNCTION notify_%1$s() RETURNS TRIGGER AS $$
Expand Down