-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
As per
bernard/src/Driver/DoctrineDriver.php
Lines 40 to 45 in 3b78158
| try { | |
| $this->connection->insert('bernard_queues', ['name' => $queueName]); | |
| } catch (\Exception $e) { | |
| // Because SQL server does not support a portable INSERT ON IGNORE syntax | |
| // this ignores error based on primary key. | |
| } |
INSERT statements that will fail.
While this seems to be acceptable at first, some database engines mark transactions with failed SQL statements as "failed transactions", rendering the entire DB connection unusable.
Few things to be done here
- wrap the entire statement in a transaction (safest way)
- use
INSERT IGNORE(not always supported, therefore not going there) - do a
SELECTand then anINSERT(relatively low-risk, since queues don't get destroyed/recreated often)
I'll provide a patch for this today, if this seems reasonable.
Metadata
Metadata
Assignees
Labels
No labels