rebus-org / Rebus.PostgreSql

:bus: PostgreSQL persistence for Rebus
https://mookid.dk/category/rebus
Other
17 stars 19 forks source link

Added support for ambient transactions #14

Closed KasperDamgaard closed 4 years ago

KasperDamgaard commented 4 years ago

This PR enables support for ambient transactions e.g. via the built-in .net TransactionScope. It's more or less taken from https://github.com/rebus-org/Rebus.SqlServer/blob/master/Rebus.SqlServer - we need to ensure that rebus messages are only committed if the whole transaction is good, and rebus messages are just one of the transactions we need. This should enable it. I first tried getting https://github.com/rebus-org/Rebus.TransactionScopes to work, but that does not seem to do anything using the postgresql transport. These changes makes our project function as intended, but if you have a different approach we should take, let me know.

If possible, it would be awesome to get these changes into release 5.x as well as we cannot get 6.x to work with our setup. Not sure how to do that PR though.

Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.

claassistantio commented 4 years ago

CLA assistant check
All committers have signed the CLA.

mookid8000 commented 4 years ago

Cool, thanks! 😃 Your contribution is out as Rebus.PostgreSql 6.0.0, targeting Rebus 5.