I have a simple Biztalk Application 2013-r2 that imports a file into a table, then executes a long running post import process (via stored procedures).
Symptoms: when importing 2 files
- The import of the first file has no issues
- Then, the post processing starts (slow as expected due to long running stored procedure)
- Then if you drop a second file, the first file post processing dissapears and the second import takes place.
- Then they start alternating back and forth (you can see the post processing field being populated as expected)
- Both send ports are active, sometimes you see a third one dehydrated
Since there are no errors reported, this must be a setting or do I need to move the post processing out of the long running transaction?
Details:
- Orchestration Transaction Type is long running
- The time out for the post processing send port is 59 minutes
- The post processing stored procedure invokes child stored procedures.
- No errors are reported anywhere
- Both send ports have ordered delivery checked
Post Processing Stored Procedures:
CREATE PROCEDURE [sync].[MPostProcessing]
@Code NVARCHAR(2)
AS
----
---- 2. Normalize Address
----
IF @Code = '99'
EXEC sync.AElBatch @Code = @Code
CREATE PROCEDURE [sync].[AElBatch ] @Code AS VARCHAR(2)
AS
DECLARE @ID AS INT
WHILE EXISTS ( SELECT ID
FROM sync.[mtable]
WHERE Code = @Code
AND PostProcessingDone = 0 )
BEGIN
SELECT TOP 1
@ID = ID
FROM sync.[mtable]
WHERE Code = @Code
AND PostProcessingDone = 0
EXEC sync.PParse @ID = @ID
UPDATE sync.[mtable]
SET PostProcessingDone = 1
WHERE Code = @Code
AND ID = @ID
END
And then the PPArse stored procedure does more (all working, no errors reported)
Image of Biztalk Server Administration Console