Skip to content

Commit 2ecbffb

Browse files
authored
dotnet: clarify global mode transaction state (#12919)
1 parent 18e883e commit 2ecbffb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/platforms/dotnet/common/configuration/options.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ Example scenarios where it should be explicitly set to true:
4949

5050
Defaults to `false`, unless in Blazor WASM, MAUI, Unity, or Xamarin where the default is `true`.
5151

52-
In server applications, when Global Mode is **disabled**, data stored in the scope is only available in the context of the particular request in which it is created.
52+
When Global Mode is **disabled** data stored in the scope is set on the current [ExecutionContext](https://learn.microsoft.com/en-us/dotnet/api/system.threading.executioncontext).
53+
In server applications data stored in the scope is only available in the context of the particular request in which it is created.
54+
Broadly, the ExecutionContext passes to child tasks and threads, but not to parent tasks and threads.
5355

54-
For UI applications (like MAUI) when Global mode is **enabled**, a single scope stack is shared by the whole application.
56+
When Global Mode is **enabled**, a single scope stack is shared by the whole application.
57+
58+
Since version 5.0.0 the transaction is always set on the current ExecutionContext, regardless of the Global Mode, so that spans from the UI don't get mixed up with transactions in background services.
5559

5660
See the <PlatformLink to="/enriching-events/scopes/">Scopes and Hubs documentation</PlatformLink> for more information.
5761

0 commit comments

Comments
 (0)