File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
docs/client-api/configuration/load-balance Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ private string GetDefaultContext(string dbName)
99
99
\{
100
100
// Get the string set by the web application elsewhere.
101
101
var ctx = System.Web.HttpContext.Current;
102
- if (ctx == null || ctx.Items.Contains(ContextKey) == false )
102
+ if (ctx == null)
103
103
{
104
104
// return a safe default
105
105
return dbName;
@@ -130,14 +130,13 @@ using (var session = documentStore.OpenSession())
130
130
{ ` // Open a session that will use a UNIQUE context string:
131
131
using (var session = documentStore.OpenSession())
132
132
\{
133
- // Call SetContext, pass a unique context string for this session.
134
- // In this case, a team identifier, where both employees belong to.
133
+ // Call ' SetContext' to assign a dedicated context string for this session.
134
+ // For example: "team/9-A", representing the team that the employees loaded in this session belong to.
135
135
session.Advanced.SessionInfo.SetContext("team/9-A");
136
136
137
- // For all Read & Write requests made in this session,
138
- // node to access is calculated from the unique string & the seed defined on the store
137
+ // For all Read & Write requests made in this session, including the following load calls,
138
+ // a node to access is calculated from the unique string & the seed defined on the store
139
139
var employee1 = session.Load<Employee>("employees/1-A");
140
-
141
140
var employee2 = session.Load<Employee>("employees/3-A");
142
141
\}
143
142
` }
You can’t perform that action at this time.
0 commit comments