简体   繁体   中英

How does Sql Server Service Broker interact with MSDTC

We have a situation where we are sending a message on a Service Broker queue as part of a distributed transaction. Obviously we only want the message sent if the transaction completes.

However we are finding that in this situation, the recieving end of the queue recieves the message before the transaction commits, somehow becoming enrolled too. This is causing knock on problems if the sender then rolls back, eventually leading to the queue being disabled due to poison messages.

Is this expected behaviour? If so, how can we send messages transactionally?

Could it be so, that you are reading queue with NOLOCK hint? in that case- you can see message in the queue, but actually you cannot receive it! And only after transaction commits, it can be received.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM