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)
9999\{
100100 // Get the string set by the web application elsewhere.
101101 var ctx = System.Web.HttpContext.Current;
102- if (ctx == null || ctx.Items.Contains(ContextKey) == false )
102+ if (ctx == null)
103103 {
104104 // return a safe default
105105 return dbName;
@@ -130,14 +130,13 @@ using (var session = documentStore.OpenSession())
130130{ ` // Open a session that will use a UNIQUE context string:
131131using (var session = documentStore.OpenSession())
132132\{
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.
135135 session.Advanced.SessionInfo.SetContext("team/9-A");
136136
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
139139 var employee1 = session.Load<Employee>("employees/1-A");
140-
141140 var employee2 = session.Load<Employee>("employees/3-A");
142141\}
143142` }
You can’t perform that action at this time.
0 commit comments