Foreign key constraint XFKJobRunJobStreamRun_JobRun - AAI stops processing

book

Article ID: 208043

calendar_today

Updated On:

Products

Automic Automation Intelligence

Issue/Introduction

Symptoms:

AAI Jammer gets stuck, the following errors are present in the log files:

1. The INSERT statement conflicted with the FOREIGN KEY constraint "XFKJobRunJobStreamRun_JobRun".

The conflict occurred in database "JAWS", table "dbo.JobRun", column 'jobRunId'. Full warning: 2021-02-01 20:00:22,137 WARN [JobStreamRunUpdaterImpl] Received Exception when trying to commit JobStream Run data.

Retrying for Duration[5:00]: com.termalabs.common.datastore.DataAccessException: Flush failed at com.termalabs.common.connection.hibernate.GenericSessionImpl.timedCommit(GenericSessionImpl.java:381) at com.termalabs.common.connection.hibernate.GenericSessionImpl.commit(GenericSessionImpl.java:254) at com.termalabs.server.cache.jobstream.JobStreamRunUpdaterImpl.commit(JobStreamRunUpdaterImpl.java:455) at com.termalabs.server.app.jobstream.run.ActiveJobStreamRunBuilderImpl.associateLatestRuns(ActiveJobStreamRunBuilderImpl.java:198) at com.termalabs.server.system.RunCycle.runJobStreamRunBuilder(RunCycle.java:1066) at com.termalabs.server.system.RunCycle.compute(RunCycle.java:399) at com.termalabs.server.system.CommonJammerSequence.runCycle(CommonJammerSequence.java:225) at com.termalabs.server.system.CommonJammerSequence.runJammerSequence(CommonJammerSequence.java:158) at com.termalabs.server.system.JammerSequence.run(JammerSequence.java:141) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109) at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2242) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2678) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028) ... 13 in common Caused by: java.sql.BatchUpdateException: The INSERT statement conflicted with the FOREIGN KEY constraint "XFKJobRunJobStreamRun_JobRun". The conflict occurred in database "JAWS", table "dbo.JobRun", column 'jobRunId'. at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:1106) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) ... 26 in common

 

and followed by the following error

2. java.sql.BatchUpdateException: Cannot insert duplicate key row in object 'dbo.JobStreamRun_JobRun' with unique index 'XAK1JobStreamRun_JobRun'. The duplicate key value is (AXddmH7rToc=, AXddljCYbbY=).

 

 

Cause

Defect

Environment

Release : 6.1.1

Component : AUTOMIC AUTOMATION INTELLIGENCE ENGINE

Resolution

Upgrade to AAI 6.3.0-1 or higher. 

Workaround is described in this Knowledge Base Article.