Skip to main content
Kofax

Merge Exception from Reporting function LoadEventDataDim.PerformUpdates

3018675

Question / Problem: 

What may be the problem when reporting logs show an SQL MERGE exception from the function Kofax.Reporting.ETLAgent.Core.Warehouse.Load.LoadEventDataDim.PerformUpdates?

Answer / Solution: 

Identifying this issue in reporting logs

The following section of a reporting log with a stack trace help identify that an error arises from this specific par to of the reporting process.  The bolded sections help identify this specific where an error is the same as the one described here.  Note that there are different possible exceptions that can come from this same spot.

Reporting Information: 4 : Executing PerformUpdates task LoadEventDataDimPage
Reporting Information: 4 : DocumentSystemClassified, AcceptSuggKtmClass, ChangeConfKtmClass, ChangeSuggKtmClass events ...
Reporting Information: 4 : 0 rows affected
Reporting Information: 4 : 0 rows affected
Reporting Information: 4 : PagesMove, SplitDocument, MergeDocument events ...
Reporting Information: 4 : 0 rows affected
Reporting Information: 4 : 0 rows affected
Reporting Error: 6 : Error PerformUpdates task
Reporting Error: 6 : Exception: The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.
Reporting Error: 6 : Stack trace:   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
  at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
  at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
  at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
  at Kofax.Reporting.ETLAgent.Core.DataAccess.SqlDataProvider.ExecuteNonQuery(String sqlCommand)
  at Kofax.Reporting.ETLAgent.Core.Warehouse.Load.LoadEventDataDim.PerformUpdates()
  at Kofax.Reporting.ETLAgent.Core.Warehouse.Load.LoadDataTaskHost.PerformUpdates()

MERGE Exception

The full text of the exception message is here:
The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.

It is important to understand that this is a generic error message from SQL Server.  If a MERGE error occurs with a different stack trace, then it is a different underlying problem.

This particular instance of the error, with this specific stack trace, is resolved in the following versions:

  • 7.5.0.19 - 1373937 Case 25051197: The MERGE statement attempted to UPDATE or DELETE the same row more than once
  • 7.6.0.7 - 1373941 Case 25051197: The MERGE statement attempted to UPDATE or DELETE the same row more than once 
  • 7.7.0.3 - 1373945 Case 25051197: [Reporting] The MERGE statement attempted to UPDATE or DELETE the same row more than once 
  • 7.8.0.0 - 1328731: [Reporting] The MERGE statement attempted to UPDATE or DELETE the same row more than once.

 

Applies to:  

Product Version
KTA 7.5
KTA 7.6
KTA 7.7