diff --git a/Modules.Patterns/Modules/BaseModule.vb b/Modules.Patterns/Modules/BaseModule.vb index 7619462f..82ac08e3 100644 --- a/Modules.Patterns/Modules/BaseModule.vb +++ b/Modules.Patterns/Modules/BaseModule.vb @@ -9,7 +9,7 @@ Namespace Modules "SELECT ", "UPDATE ", "DELETE ", "EXEC " } - Private Const MAX_TRY_COUNT = 500 + Private Const MAX_TRY_COUNT = 100 Public Sub New(pLogConfig As LogConfig) Logger = pLogConfig.GetLogger() diff --git a/Modules.Patterns/Modules/Globix/GlobixAutomatic.vb b/Modules.Patterns/Modules/Globix/GlobixAutomatic.vb index 38a6950b..9f0dd236 100644 --- a/Modules.Patterns/Modules/Globix/GlobixAutomatic.vb +++ b/Modules.Patterns/Modules/Globix/GlobixAutomatic.vb @@ -28,22 +28,24 @@ Namespace Modules.Globix While ContainsPattern(oResult, PatternIdentifier) Try Dim oIndexName As String = GetNextPattern(oResult, PatternIdentifier).Value + Logger.Info("Replacing value for Index {0}", oIndexName) If pIndexes.ContainsKey(oIndexName) = False Then Logger.Warn("Value for Index [{0}] does not exist and will not be used for replacing. Skipping.", oIndexName) + + Else + ' TODO: If Index contains multiple values, only the first value will be used as value + Dim oIndexValues As List(Of String) = pIndexes.Item(oIndexName) + Dim oFirstValue As String = oIndexValues.FirstOrDefault() + + If oFirstValue Is Nothing Then + Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Skipping.") + Return oResult + End If + + oResult = ReplacePattern(oResult, PatternIdentifier, oFirstValue) End If - ' TODO: If Index contains multiple values, only the first value will be used as value - Dim oIndexValues As List(Of String) = pIndexes.Item(oIndexName) - Dim oFirstValue As String = oIndexValues.FirstOrDefault() - - If oFirstValue Is Nothing Then - Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Skipping.") - Return oResult - End If - - oResult = ReplacePattern(oResult, PatternIdentifier, oFirstValue) - Catch ex As Exception Logger.Error(ex) Return oResult diff --git a/Modules.Patterns/Modules/Internal.vb b/Modules.Patterns/Modules/Internal.vb index 65d075ef..c7cc56d7 100644 --- a/Modules.Patterns/Modules/Internal.vb +++ b/Modules.Patterns/Modules/Internal.vb @@ -38,7 +38,7 @@ Namespace Modules ' Replace CurrentDate(s) While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_YYYY_MM_DD) Logger.Trace("Replacing Pattern [{0}]", INT_VALUE_DATE_YYYY_MM_DD) - oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy/MM/dd")) + oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy\\MM\\dd")) IncrementCounterOrThrow(oCounter) End While