Jobs: Close connection for Update_HistoryEntry as well

This commit is contained in:
Jonathan Jenne 2021-07-14 12:07:25 +02:00
parent dfb6e5cf5c
commit 90c1a5409f

View File

@ -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)