2

My program makes use of NServiceBus as the service bus. Now, when I run a some part of my program, it fires a command to initiate a process. This process involves data look up from a database (with A lot of data) by 3 separate handlers (classes) in the program. So, in some way, they are happening in parallel. As these 3 classes receives and handles the same command, then starts work

Searching through similar posts on stack overflow, I've come across a number of suggestions. Including 'increasing the timeout time' in both the config and machine.config. Done this to know avail.

This post! made me realise it could be an issue with NServiceBus and MSDTC.

I've also attached visual studio debugger to the program process and witnessed the exception taking place at every point where I'm querying a repository class - which queries the database.

System.Transactions.TransactionException occurred
  HResult=-2146233087
  Message=The operation is not valid for the state of the transaction.
  Source=System.Transactions
  StackTrace:
       at 
System.Transactions.TransactionState.EnlistVolatile(InternalTransaction 
tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions 
enlistmentOptions, Transaction atomicTransaction)
  InnerException: 

I'm tempted to just have a try catch everywhere. But that's me getting desperate. And, I'm ignoring a lot of data.

Please, any ideas? All response will be appreciated.

user54287
  • 69
  • 9

0 Answers0