Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 9bc11a1

Browse files
committed
more code blocks
1 parent 7e8812a commit 9bc11a1

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

docs/database-engine/service-broker/handling-poison-messages.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ Consider the following questions when you decide how the application handles a p
3636

3737
## Example: Detecting a Poison Message
3838

39-
40-
4139
This Transact-SQL example shows a simple, stateless service that includes logic for handling poison messages. Before the stored procedure receives a message, the procedure saves the transaction. When the procedure cannot process a message, the procedure rolls the transaction back to the save point. The partial rollback returns the message to the queue while continuing to hold a lock on the conversation group for the message. Because the program continues to hold the conversation group lock, the program can update a table that maintains a list of failed messages without risk that another queue reader might process the message.
4240

4341
The following example defines the activation stored procedure for the application:
4442

45-
```
43+
```sql
4644
CREATE PROCEDURE ProcessExpenseReport
4745
AS
4846
BEGIN
@@ -116,7 +114,7 @@ The following example defines the activation stored procedure for the applicatio
116114

117115
The stored procedure TrackMessage tracks the number of times that a message has failed. When the message has not failed before, the procedure inserts a new counter for the message into the table ExpenseServiceFailedMessages. Otherwise, the procedure checks the counter for the number of times that the message failed. The procedure increments the counter when the counter is less than a predefined number. When the counter is greater than the predefined number, the procedure ends the conversation with an error and removes the counter for the conversation from the table.
118116

119-
```
117+
```sql
120118
CREATE PROCEDURE TrackMessage
121119
@conversationHandle uniqueidentifier
122120
AS
@@ -154,7 +152,7 @@ The stored procedure TrackMessage tracks the number of times that a message has
154152

155153
The definition of table ExpenseServiceFailedMessages simply contains a conversation_handle column and a count column, as shown in the following sample:
156154

157-
```
155+
```sql
158156
CREATE TABLE ExpenseServiceFailedMessages (
159157
conversation_handle uniqueidentifier PRIMARY KEY,
160158
count smallint
@@ -163,7 +161,7 @@ The definition of table ExpenseServiceFailedMessages simply contains a conversat
163161

164162
The procedure ClearMessageTracking deletes the counter for a conversation from the table ExpenseServiceFailedMessages, as shown in the following sample:
165163

166-
```
164+
```sql
167165
CREATE PROCEDURE ClearMessageTracking
168166
@conversationHandle uniqueidentifier
169167
AS
@@ -196,5 +194,4 @@ If you believe that the processing you perform on the message might cause a tran
196194

197195
#### Other Resources
198196

199-
[Understanding Database Engine Errors](../../relational-databases/errors-events/understanding-database-engine-errors.md)
200-
197+
[Understanding Database Engine Errors](../../relational-databases/errors-events/understanding-database-engine-errors.md)

0 commit comments

Comments
 (0)