Skip to content

Commit c5b61a6

Browse files
committed
CommandFactory: cache boolean value to have less operations on command part creation
1 parent 5eb303e commit c5b61a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Orm/Xtensive.Orm/Orm/Providers/CommandProcessing/CommandFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class CommandFactory
2424
private const int LobBlockSize = ushort.MaxValue;
2525

2626
private readonly bool emptyStringIsNull;
27+
private readonly bool shareStorageNodesOverNodes;
2728

2829
public StorageDriver Driver { get; private set; }
2930

@@ -103,7 +104,6 @@ public virtual CommandPart CreateQueryPart(IQueryRequest request, in string para
103104
var upgradeContext = Upgrade.UpgradeContext.GetCurrent(Session.Domain.UpgradeContextCookie);
104105
var nodeConfiguration = upgradeContext != null ? upgradeContext.NodeConfiguration : Session.StorageNode.Configuration;
105106

106-
var shareStorageNodesOverNodes = Session.Domain.Configuration.ShareStorageSchemaOverNodes;
107107
var configuration = shareStorageNodesOverNodes
108108
? new SqlPostCompilerConfiguration(nodeConfiguration.GetDatabaseMapping(), nodeConfiguration.GetSchemaMapping())
109109
: new SqlPostCompilerConfiguration();
@@ -299,6 +299,7 @@ public CommandFactory(StorageDriver driver, Session session, SqlConnection conne
299299
Connection = connection;
300300

301301
emptyStringIsNull = driver.ProviderInfo.Supports(ProviderFeatures.TreatEmptyStringAsNull);
302+
shareStorageNodesOverNodes = session.Domain.Configuration.ShareStorageSchemaOverNodes;
302303
}
303304
}
304305
}

0 commit comments

Comments
 (0)