In our production system, we found out that even though some messages failed during processing, some crud operations did not entirely roll back their transactions.
You need this installed on your machine
- SqlServer (I happen to have 2017 developer edition)
- MSDTC running
MSMQ running- Visual Studio (msbuild.exe)
Run the Runme.ps1
in the root of the repository. This will
- Create the database
- Nuget restore and build the applications
- Start both applications
Once both applications are running, you can verify that the LoopService is working. It only takes a few minutes for inconsistencies to appear on my developer machine. When the Trancount
property is 0 we cannot roll back crud operations.
Verify using SQL:
We have not been able to reproduce without the transactional WCF call. In this example we also instruct NServiceBus to NOT to create a transaction.
We have trimmed the example to the smallest amount of code possibly, only leaving logging and some database cruds for demo purposes. We have also disabled NServiceBus transaction handling, only leaving our own TransactionScope.
All the important bits are in the DemoService\Handlers\DostuffHandler.cs
and DemoService\Infrastructure\EndpointConfig.cs
files.