Fix #251: dbal driver - safe queue creation by Ocramius · Pull Request #252 · bernardphp/bernard
Since we don't have UPSERT support in DBAL (and sadly will not be in it for a while), this PR fixes #251 by providing graceful handling of queue creation.
- operations are executed in a transaction
- only unique constraint exceptions are caught (very important! if the DB dies, that's not something we can ignore)
- avoid causing duplicate key issues, when possible
|
|
||
| $driver = new DoctrineDriver($connection); | ||
|
|
||
| $driver->createQueue('foo'); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: no assertions provided here. The assertion is self::once() on the insert call.
@henrikbjorn what can I do to speed up the merge of this one? As explained on #275 this prevents Bernard to work on PostgreSQL 9.5.x
@Ocramius Thanks for this, sorry for me being so slow getting back and merging this.
@henrikbjorn sorry to disturb you again, but I'm wondering if you intentionally merged it on 0.x branch. If it is intentional, what's the process to have it merged back on master?
@danydev you are a life saver, didn't even notice. I have merged it into the master branch as well.
Ocramius
deleted the
fix/#251-dbal-queue-safe-queue-creation
branch
Hi @henrikbjorn ! We could really use this fix on master, even better if in a new tagged release. Are you able to merge this to master or are there any issues?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters