Skip to content
Documentation
Updated 5 minutes to read
Markdown

Updating Log Events after update to Nodinite 5.4 or later

Section titled “ Updating Log Events after update to Nodinite 5.4 or later”

This article only applies if you have Logging enabled from BizTalk Server to Nodinite. This fix only needs to be applied once.

There is an invalid translation of two-way Endpoint Directions for Microsoft BizTalk Server with versions before Nodinite 5.4. If you update to 5.4 or later, you may want to correct this. On this page is a template script to help you update the content in the Nodinite Log Databases.

Use the Log Audit Search feature to find the data of interest. You must enter the Date when you applied the Nodinite update.

  1. Enter the following text in the operations filter:
List of Endpoint Ids with changed direction
  1. Copy the LogAgentValueId and use it in the update script (@logAgentValueId)
  2. Copy the comma-separated string with EndpointIds and use it in the update script (@CommadelimitedString). Log Audits Search
    Find the required values to use in the update script.

You need to execute a script to update the Events table in every Log Database.

Replace the parameters as necessary and repeat the operation on all Log Databases.

DECLARE @CommadelimitedString VARCHAR(MAX) = '23,30,33,35' -- Replace from Log Audits search
DECLARE @LogDatabase VARCHAR(255)= 'NodiniteLog_Test72_20220114' -- Replace with the name of the target Nodinite Log Database
DECLARE @logAgentValueId INT = 1 -- VERY IMPORTANT THAT YOU SET THIS ACCORDINGLY, CONTACT THE NODINITE SUPPORT IF YOU ARE UNCERTAIN
-- Loop over all changed Endpoints
-- Find the current EndpointDirection
-- Update the Events table with the new direction for the Endpoint from the list in cursor loop
DECLARE @ChangedEndpoints TABLE (EndpointId BIGINT)
DECLARE @IntLocation INT
WHILE (CHARINDEX(',', @CommadelimitedString, 0) > 0)
BEGIN
SET @IntLocation = CHARINDEX(',', @CommadelimitedString, 0)
INSERT INTO @ChangedEndpoints (EndpointId)
--LTRIM and RTRIM to ensure blank spaces are removed
SELECT RTRIM(LTRIM(SUBSTRING(@CommadelimitedString, 0, @IntLocation)))
SET @CommadelimitedString = STUFF(@CommadelimitedString, 1, @IntLocation, '')
END
INSERT INTO @ChangedEndpoints (EndpointId)
SELECT RTRIM(LTRIM(@CommadelimitedString))
DECLARE @rowCount INT
DECLARE @tsql NVARCHAR(MAX)
DECLARE @direction INT
DECLARE @EndpointId INT
DECLARE Endpoints_Cursor CURSOR FOR SELECT [EndpointId] FROM @ChangedEndpoints ORDER BY [EndpointId] DESC
-- Open the cursor to loop through all rows.
OPEN Endpoints_Cursor;
FETCH NEXT FROM Endpoints_Cursor INTO @EndpointId
WHILE @@FETCH_STATUS = 0
BEGIN
-- Find current direction for Endpoint
SELECT @direction = E.Direction from EndPoints E WHERE E.[EndPointId] = @EndpointId
PRINT 'Updating Events for Endpoints with EndpointId: ' + CAST(@EndpointId AS VARCHAR(18)) + '. New Direction is: ' + CAST(@direction AS VARCHAR(18))
SET @tsql = 'UPDATE ' + @LogDatabase + '.dbo.Events SET EndPointDirection= ' + CAST(@direction AS VARCHAR(18)) +
' WHERE EventId IN (SELECT TOP 50000 EventId FROM ' + @LogDatabase + '.dbo.[Events] WHERE EndPointId = ' + CAST(@EndpointId AS VARCHAR(18))
+ ' AND EndPointDirection <> ' + CAST(@direction AS VARCHAR(18)) + ' AND AgentSourceId=' + CAST(@logAgentValueId AS VARCHAR(18)) + ')'
PRINT @tsql
WHILE 1 = 1
BEGIN
EXEC sp_executesql @tsql
SET @rowCount = @@ROWCOUNT
PRINT 'Updated ' + CAST(@rowCount AS VARCHAR(18)) + ' rows in the Events table.'
IF @rowCount <> 50000
BREAK
END
FETCH NEXT FROM Endpoints_Cursor INTO @EndpointId
END;
CLOSE Endpoints_Cursor;
DEALLOCATE Endpoints_Cursor;

If you use the Direction search field in Log Views, you may need to modify them to include the Two-Way direction instead.

  • If you update the Log Databases with the script, change Receive to Two-Way Receive.
  • If you do NOT update Log Databases with the script, Add the mathematical operator from = to IN and make sure to include both Receive and Two-Way Receive.
    Include Two-Way Receive
    Example when you did not modify the Log Database.
  • If you update the Log Databases with the script, change Send to Two-Way Send.
  • If you do NOT update Log Databases with the script, Add the mathematical operator from = to IN and make sure to include both Send and Two-Way Send.
    Include Two-Way Send
    Example when you did not modify the Log Database.

Log Events
BizTalk Logging Overview

Update Nodinite
Log Databases

...

Version:
Release date: N/A
Loading...

Explore Nodinite for 30 days – completely free

  • Find out why this is the leading O&M software
  • Prove your business case
  • Test the self-service for the business side

Loading...

See how Nodinite resolves your technical issues, in a LIVE Demo!

Once you submit this request:

  • We will give you a short call to understand the issues you want to tackle.
  • Understand solutions you have tried and why were you not happy with them.
  • Book a convenient slot for a LIVE demo!

Loading...