/// <summary> /// Determines if a connection is being made to a SQL DW database. /// </summary> /// <param name="conn">A connection object.</param> private bool IsSqlDwConnection(IDbConnection conn) { //Set the connection only if it has not been set earlier. //This is assuming that it is highly unlikely for a connection to change between instances. //Hence any subsequent calls to this method will just return the cached value and not //verify again if this is a SQL DW database connection or not. if (!CachedServerInfo.Instance.TryGetIsSqlDw(conn, out _isSqlDwDatabase)) { _isSqlDwDatabase = ReliableConnectionHelper.IsSqlDwDatabase(conn); CachedServerInfo.Instance.AddOrUpdateIsSqlDw(conn, _isSqlDwDatabase);; } return(_isSqlDwDatabase); }