diff --git a/Modules.Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb b/Modules.Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb index b8797d48..d0ae040c 100644 --- a/Modules.Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Modules.Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -655,7 +655,7 @@ Public Class ImportZUGFeRDFiles Dim oSQL = $"INSERT INTO TBEDM_ZUGFERD_HISTORY_IN (COMMENT, MD5HASH, MESSAGE_ID) VALUES ('{Message}', '{MD5Checksum}', '{MessageId}')" ' 09.07.2021: This can't be in the transaction since the history - ' entry needs to be accessed by MoveAndRenameEmailToRejected shortly after + ' Entry needs to be accessed by MoveAndRenameEmailToRejected shortly after _firebird.ExecuteNonQueryWithConnection(oSQL, oConnection, Firebird.TransactionMode.WithTransaction) ' Close the connection @@ -674,8 +674,12 @@ Public Class ImportZUGFeRDFiles Try Dim oConnection = _firebird.GetConnection() Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = '{Message}' WHERE MD5HASH = '{MD5Checksum}' AND MESSAGE_ID = '{MessageId}'" + _firebird.ExecuteNonQueryWithConnection(oSQL, oConnection, Firebird.TransactionMode.WithTransaction) + ' Close the connection + oConnection.Close() + Return True Catch ex As Exception _logger.Warn("History Entry count not be updated for message id [{0}] and md5 [{1}]", MessageId, MD5Checksum)