After reading the article "A First Look at SQL Server 2005 Service Broker"
by Roger Wolter (http://www.microsoft.com/indonesia/msdn/sqlsvcbroker.asp),
I have a simple question to the scenario one in that article,
Because the Figures in the original article is lost, I put one on my
machine, link the following link,
http://www.liwasoft.com/Others/FirstLookat.htm#Scenarios
My Question is about the scenario one, Order Entry.
According to the original article, "As the Order Entry service inserts the
order headers and order lines into the database, it queues messages to the
billing, shipping, inventory, and credit limit services to finish processing
the order."
I Found that there are not only four arrow line from Order Entry Service to
the other four Queues (green lines), but also four arrow line from Other
Services to the Order Entry Queue (pink lines).
I don't understand why there are four pink lines there.
In my thought, Order Entry Queue is a queue to append order entry messages,
not a queue for append an approved messages. If the Order Entry Queue do
accept the approved messages, Service Broker would activate more new Queue
Readers to process that messages. The original Queue Reader would not get
the approved messages, but the new ones would.
Am I right?
--Frank
Roger Wolter[MSFT] - 27 Dec 2005 05:32 GMT
No, that's the reason for Conversation group locking. All four of the
conversations would be locked whenever a message is received on any one of
the dialogs so even though there might be many different queue readers
receiving messages, the messages from this particular conversation group
would only be received by one thread at a time because the conversation
group is locked.

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
> After reading the article "A First Look at SQL Server 2005 Service Broker"
> by Roger Wolter
[quoted text clipped - 27 lines]
>
> --Frank
Frank Lee - 27 Dec 2005 11:45 GMT
Well, sorry, but I still do not know clearly.
If I try to using the scenario of "Queuing at the Airport" to say, that is
just like the "several people in the line are part of a group", or just like
the "when another message from a conversation group arrives after the
transaction holding the conversation group commits"? Which one is better?
"Roger Wolter[MSFT]" <rwolter@online.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:eX8zMcqCGHA.2300@TK2MSFTNGP15.phx.gbl...
> No, that's the reason for Conversation group locking. All four of the
> conversations would be locked whenever a message is received on any one of
> the dialogs so even though there might be many different queue readers
> receiving messages, the messages from this particular conversation group
> would only be received by one thread at a time because the conversation
> group is locked.
Roger Wolter[MSFT] - 27 Dec 2005 20:12 GMT
Neither one is better or worse - they are both situations that can happen in
asynchronous messaging. Processing all the messages in the queue related to
the same business transaction in a single database transaction simplifies
message processing because you don't need to deal with related messages
being processed by different threads simultaneously. Once you have handled
the messages currently on the queue, if you are expecting more returns from
the same business transaction, you need to save off the current state of the
business transaction and commit the database transaction because it may be a
long time before the other messages arrive.

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
> Well, sorry, but I still do not know clearly.
>
[quoted text clipped - 11 lines]
>> would only be received by one thread at a time because the conversation
>> group is locked.
Frank Lee - 28 Dec 2005 01:40 GMT
OK, thanks.
"Roger Wolter[MSFT]" <rwolter@online.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:uVj7wHyCGHA.3784@TK2MSFTNGP15.phx.gbl...
> Neither one is better or worse - they are both situations that can happen
> in asynchronous messaging. Processing all the messages in the queue
[quoted text clipped - 22 lines]
>>> conversation group would only be received by one thread at a time
>>> because the conversation group is locked.