Service Broker: How should a trigger start infinitely opened dialog?

醉酒当歌 提交于 2019-12-25 04:51:23

问题


The question is a continuation of the Service Broker: Designing the communication between two SQL servers (to make the earlier reasonably short).

The answer to the above question suggested the usage of a simpler scenario of sending the regularly generated data via forever opened dialog. A trigger, that is responsible for forming the data at the satellite SQL server and sending it do the central SQL server, will probably use the fixed unique identifier.

Anyway, the conversation must be started at first. Say, the conversation handle is fixed. How can I detect the situation when the conversation was not open yet?

If it is possible to detect the conversation was not started yet, I could combine the two approaches. The special request with empty-string message value could be send to the central, and the central would send back a reply only for that special request. The satellite activated procedure would then send the missing data to the central at once.

Simply said, I have to solve the initial situation when quite a lot of data could be collected at the satellite machine. The satellite activated procedure could sent the data in chunks to give both sides a chance to do also something else than moving the data. Once the reply message from the central arrives in situation when there is nothing else to send, the activated procedure could set some persistent flag for the trigger to start sending the single records in a monolog way. Is it reasonable?


回答1:


See the Remus Rusanu's comment for the answer.

(My answer is just for finishing the question.)



来源:https://stackoverflow.com/questions/13203389/service-broker-how-should-a-trigger-start-infinitely-opened-dialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!