Skip to content

Commit 003a1f4

Browse files
committed
Legacy docs review
1 parent e871a1d commit 003a1f4

File tree

13 files changed

+55
-55
lines changed

13 files changed

+55
-55
lines changed

persistence/azure-table/scripting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure Table Persistence Scripts
33
summary: Collection of scripts for managing Azure Table Persistence
44
component: ASP
5-
reviewed: 2022-12-16
5+
reviewed: 2025-03-18
66
related:
77
- nservicebus/operations
88
redirects:

persistence/sql/saga-concurrency.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: SQL Persistence saga concurrency
33
component: SqlPersistence
4-
reviewed: 2022-11-24
4+
reviewed: 2025-03-18
55
related:
66
- nservicebus/sagas/concurrency
77
redirects:
@@ -10,7 +10,7 @@ redirects:
1010

1111
## Default behavior
1212

13-
When simultaneously handling messages, conflicts may occur. See below for examples. _[Saga concurrency](/nservicebus/sagas/concurrency.md)_ explains how these conflicts are handled, and contains guidance for high-load scenarios.
13+
When simultaneously handling messages, conflicts may occur. See below for examples. [Saga concurrency](/nservicebus/sagas/concurrency.md) explains how these conflicts are handled and contains guidance for high-load scenarios.
1414

1515
### Starting a saga
1616

@@ -43,4 +43,14 @@ values
4343

4444
### Updating or deleting saga data
4545

46-
partial: updating-deleting
46+
Starting in version 4.1.1, conflicts cannot occur because the persistence uses pessimistic locking. Pessimistic locking is achieved by performing a `SELECT ... FOR UPDATE` or its dialect-specific equivalent.
47+
48+
Up to and including version 4.1.0, SQL persistence uses [optimistic concurrency control](https://en.wikipedia.org/wiki/Optimistic_concurrency_control) when updating or deleting saga data.
49+
50+
Example exception:
51+
52+
```
53+
System.Exception: Optimistic concurrency violation when trying to complete saga OrderSaga 699d0b1a-e2bf-49fd-8f26-aadf01009eaf. Expected version 4.
54+
```
55+
56+
include: saga-concurrency

persistence/sql/saga-concurrency_updating-deleting_sqlpersistence_[4,).partial.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/web/blazor-server-application/Core_8/Server/CommandMessageHandler.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
using NServiceBus;
1+
using System.Threading.Tasks;
2+
using NServiceBus;
23
using NServiceBus.Logging;
3-
using System.Threading.Tasks;
44

55
#region Handler
66

7-
public class CommandMessageHandler :
8-
IHandleMessages<Command>
7+
public class CommandMessageHandler : IHandleMessages<Command>
98
{
10-
static ILog log = LogManager.GetLogger<CommandMessageHandler>();
9+
static readonly ILog log = LogManager.GetLogger<CommandMessageHandler>();
1110

1211
public Task Handle(Command message, IMessageHandlerContext context)
1312
{
1413
log.Info("Hello from CommandMessageHandler");
14+
1515
Task reply;
16+
1617
if (message.Id % 2 == 0)
1718
{
1819
reply = context.Reply(ErrorCodes.Fail);
@@ -21,6 +22,7 @@ public Task Handle(Command message, IMessageHandlerContext context)
2122
{
2223
reply = context.Reply(ErrorCodes.None);
2324
}
25+
2426
return reply;
2527
}
2628
}

samples/web/blazor-server-application/Core_8/Server/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
using NServiceBus;
21
using System;
32
using System.Threading.Tasks;
3+
using NServiceBus;
44

55
class Program
66
{
77
public static async Task Main()
88
{
9-
var endpointConfiguration = new EndpointConfiguration(Console.Title = "BlazorServer");
9+
Console.Title = "BlazorServer";
10+
var endpointConfiguration = new EndpointConfiguration("Samples.Blazor.Server");
1011
endpointConfiguration.EnableCallbacks(makesRequests: false);
1112
endpointConfiguration.UseSerialization<SystemJsonSerializer>();
1213
endpointConfiguration.UseTransport(new LearningTransport());
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
54
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
5+
<OutputType>Exe</OutputType>
66
<LangVersion>10.0</LangVersion>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="NServiceBus" Version="8.*" />
11-
<PackageReference Include="NServiceBus.Callbacks" Version="4.*" />
10+
<ProjectReference Include="..\Shared\Shared.csproj" />
1211
</ItemGroup>
1312

1413
<ItemGroup>
15-
<ProjectReference Include="..\Shared\Shared.csproj" />
14+
<PackageReference Include="NServiceBus.Callbacks" Version="4.*" />
1615
</ItemGroup>
1716

1817
</Project>

samples/web/blazor-server-application/Core_8/WebApp/WebApp.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="NServiceBus" Version="8.*" />
11-
<PackageReference Include="NServiceBus.Callbacks" Version="4.*" />
12-
<PackageReference Include="NServiceBus.Extensions.Hosting" Version="2.*" />
10+
<ProjectReference Include="..\Shared\Shared.csproj" />
1311
</ItemGroup>
1412

1513
<ItemGroup>
16-
<ProjectReference Include="..\Shared\Shared.csproj" />
14+
<PackageReference Include="NServiceBus.Callbacks" Version="4.*" />
15+
<PackageReference Include="NServiceBus.Extensions.Hosting" Version="2.*" />
1716
</ItemGroup>
1817

1918
</Project>

samples/web/blazor-server-application/Core_9/Server/CommandMessageHandler.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
using NServiceBus;
1+
using System.Threading.Tasks;
2+
using NServiceBus;
23
using NServiceBus.Logging;
3-
using System.Threading.Tasks;
44

55
#region Handler
66

7-
public class CommandMessageHandler :
8-
IHandleMessages<Command>
7+
public class CommandMessageHandler : IHandleMessages<Command>
98
{
10-
static ILog log = LogManager.GetLogger<CommandMessageHandler>();
9+
static readonly ILog log = LogManager.GetLogger<CommandMessageHandler>();
1110

1211
public Task Handle(Command message, IMessageHandlerContext context)
1312
{
1413
log.Info("Hello from CommandMessageHandler");
14+
1515
Task reply;
16+
1617
if (message.Id % 2 == 0)
1718
{
1819
reply = context.Reply(ErrorCodes.Fail);
@@ -21,6 +22,7 @@ public Task Handle(Command message, IMessageHandlerContext context)
2122
{
2223
reply = context.Reply(ErrorCodes.None);
2324
}
25+
2426
return reply;
2527
}
2628
}

samples/web/blazor-server-application/Core_9/Server/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
using NServiceBus;
21
using System;
32
using System.Threading.Tasks;
3+
using NServiceBus;
44

55
class Program
66
{
77
public static async Task Main()
88
{
9-
var endpointConfiguration = new EndpointConfiguration(Console.Title = "BlazorServer");
9+
Console.Title = "BlazorServer";
10+
var endpointConfiguration = new EndpointConfiguration("Samples.Blazor.Server");
1011
endpointConfiguration.EnableCallbacks(makesRequests: false);
1112
endpointConfiguration.UseSerialization<SystemJsonSerializer>();
1213
endpointConfiguration.UseTransport(new LearningTransport());
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
54
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
5+
<OutputType>Exe</OutputType>
66
<LangVersion>12.0</LangVersion>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="NServiceBus" Version="9.*" />
11-
<PackageReference Include="NServiceBus.Callbacks" Version="5.*" />
10+
<ProjectReference Include="..\Shared\Shared.csproj" />
1211
</ItemGroup>
1312

1413
<ItemGroup>
15-
<ProjectReference Include="..\Shared\Shared.csproj" />
14+
<PackageReference Include="NServiceBus.Callbacks" Version="5.*" />
1615
</ItemGroup>
1716

1817
</Project>

0 commit comments

Comments
 (0)