Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Service Broker notifications

Author  Topic 

dfiordean
Starting Member

1 Post

Posted - 2010-01-27 : 12:58:45
Hi

I'm new here as well as new to Service Broker. After reading through this piece of paper on how to setup a notification mechanism with Service Broker,

http://msdn.microsoft.com/en-us/library/ms379594(VS.80).aspx

I have a couple of questions for the forum.

First, here is a short description of my problem to solve

I have a PATIENT table (ID, name, birthdate, etc) and a PATIENT_IDENTIFIER table containing multiple identifiers for the same patient.

Now I have an SQL returning a set from the two joined tables I want to monitor for changes using Service Broker.

Here are a couple of questions regarding Service Broker

1. When a new patient is created, basically I'll have two SQL commands like

INSERT INTO PATIENT(...) VALUES (...)
...
INSERT INTO PATIENT_IDENTIFIER(...) VALUES(...)

Will I get 2 notifications in my client code for both INSERTs? Or will I get one if the two INSERTS commands are withing a BEGIN TRAN/COMMIT block? Does that make any difference?

2. As registering for notifications with Service Broker is a bit weird (notifications are one shot than the registration is removed), the question is: is there any risk to miss a notification between the time the client receives the notification and it registers for a new one (as it processes the new data)?

3. Is there any better way to register for this type of notifications than Service Broker or this is the best we have today?

Any links are welcomed.

Thanks!
   

- Advertisement -