Skip to content
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

Fix #251: dbal driver - safe queue creation #252

Merged

Conversation

Ocramius
Copy link
Contributor

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.

  1. operations are executed in a transaction
  2. only unique constraint exceptions are caught (very important! if the DB dies, that's not something we can ignore)
  3. avoid causing duplicate key issues, when possible


$driver = new DoctrineDriver($connection);

$driver->createQueue('foo');
Copy link
Contributor Author

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
Copy link
Contributor

any idea why the tests are failing?

@Ocramius
Copy link
Contributor Author

Falures are at install/pecl/pyrus. Not stuff that I touched :-\

On 25 Aug 2016 8:39 p.m., "Henrik Bjørnskov" notifications@github.com
wrote:

any idea why the tests are failing?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#252 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakJjIn4IvYp9pnQoK5HIMk4uPi_A3ks5qjeFwgaJpZM4Jp9hE
.

@danydev
Copy link

danydev commented Dec 13, 2016

@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

@henrikbjorn
Copy link
Contributor

Im currently sick so ill look at it, when my head clears up.

@henrikbjorn
Copy link
Contributor

@Ocramius Thanks for this, sorry for me being so slow getting back and merging this.

@henrikbjorn henrikbjorn merged commit 01fcfad into bernardphp:0.x Dec 15, 2016
@Ocramius
Copy link
Contributor Author

Ocramius commented Dec 15, 2016 via email

@danydev
Copy link

danydev commented Dec 15, 2016

@henrikbjorn thank you!

@ruudk
Copy link
Contributor

ruudk commented Dec 15, 2016

Thanks! You guys are awesome :D

@danydev
Copy link

danydev commented Dec 15, 2016

@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?

@henrikbjorn
Copy link
Contributor

@danydev you are a life saver, didn't even notice. I have merged it into the master branch as well.

@danydev
Copy link

danydev commented Dec 16, 2016

@henrikbjorn ahah you're welcome but I don't see it on master yet

@danydev
Copy link

danydev commented Dec 19, 2016

@henrikbjorn ping :-)

@Ocramius Ocramius deleted the fix/#251-dbal-queue-safe-queue-creation branch December 19, 2016 22:54
@asprega
Copy link

asprega commented Dec 22, 2016

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?

@danydev danydev mentioned this pull request Jan 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants