Symptoms

After upgrading from adTempus 3.x to adTempus 4, an error message with message code 5313 is periodically logged in the Alerts view, with a message similar to the following:

A database error occurred while processing a database command. This may indicate a database problem or software problem. Please contact Arcana Development for assistance and provide the server diagnostic logs. Database error: An exception was caught during the execution of an action query: The DELETE statement conflicted with the REFERENCE constraint "FK_capturedFile_executionHistoryStep". The conflict occurred in database "adtempus_XXXXXX", table "dbo.capturedFile", column 'ExecutionHistoryStepOID'.
The statement has been terminated.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.: The DELETE statement conflicted with the REFERENCE constraint "FK_capturedFile_executionHistoryStep". The conflict occurred in database "adtempus_XXXXXX", table "dbo.capturedFile", column 'ExecutionHistoryStepOID'.
The statement has been terminated. [ADT005313E]

Note: This article only applies if the error message indicates that "The DELETE statement conflicted with the REFERENCE constraint "FK_capturedFile_executionHistoryStep". If the error message does not match this, the cause of the problem is something else.

Cause

This message is reported while adTempus is cleaning up expired job history data and is caused by a problem with the way some history data was converted during the upgrade from version 3.

The problem only affects history cleanup and does not affect job execution.

Resolution

This problem can be resolved by executing a database query to correct the data.

1. Run the adTempus Database Utility as described in How to query the adTempus database.

2. Paste the following statements into the query window:

update t1 set t1.executionhistoryitemoid=t2.executionhistoryitemoid from capturedfile t1 inner join executionhistorystep t2 on t1.ExecutionHistoryStepOID =t2.oid
where t1.ExecutionHistoryItemOID is null
go

update cf set cf.filedate=o.lastmodified from capturedfile cf  join adtobject o on cf.oid=o.oid where cf.filedate is null
go

3. Press F5 to execute the commands.

After this update is run, the messages should no longer appear.

There is no need to stop or restart the adTempus service.

Status

The database conversion script has been corrected for adTempus 4.3.