How to Suspend or Kill or Resume an Integration Job

Did you kick off an integration job (integration batch) and now want to kill the job? Is the execution engine showing a job is suspended and now you want to kill it?

Watch this video for instructions on how to suspend and/or kill an integration job.

NOTE: This is not for load jobs. This is only for integration jobs. 

  1. Open the Execution Engine. You should see your suspended job highlighted in red. 
  2. Right-click the suspended queue. Click on Cancel Job
  3. You should see the integration job is now canceled and the status should be set back to READY.
    1.  



Attempt to cancel the integration job using the UI first before you try the methods below. Only use the SQL updates if absolutely necessary or if the Semarchy support team asks you to. 


NOTE: READ THIS!!! You should not kill an integration job with SQL unless it is the worst-case scenario. The SQL below is only for if the job hasn’t been running for days or weeks and you need to force Semarchy to update the integration job status.

How to cancel jobs with a direct SQL update (not using the Workbench UI)

NOTE: Only use the SQL updates if you have already tried canceling the integration job using the UI following the instructions above or if you have been directed by Semarchy support. 

  1. Confirm the list of running integration loads in the repository, using the following query. Note the Batch ID number that you want to cancel.
    1. select * from MTA_INTEG_BATCH where status = 'RUNNING';
  2. Update the Integration Batch table (MTA_INTEG_BATCH) to cancel this integration job
    1. Be sure to update the BATCHID to use the Batch ID number in step #1

      update DEV4_REPO.MTA_INTEG_BATCH
      set status = 'ERROR'
      where BATCHID = 4170
      ;

How to cancel a stuck job where the top level job has the status of error, but there is a rogue sub-step running

  1. Find the integration job in the repository, using the following query. Note the R_JOBINSTANCE ID, e.g. A1A5AE26089143FFBB91E27A177F6F5F.
    1. select * from MTA_INTEG_BATCH where status = 'RUNNING';
  2. Update the Job Log table (MTA_JOB_LOG) to cancel this sub-step. 

    update dev4_repo.mta_job_log
    set status = 'ERROR'
    where r_jobinstance = 'A1A5AE26089143FFBB91E27A177F6F5F'
    and status = 'RUNNING'
    ;

How to cancel all jobs in a queue

Run the following SQL script with the appropriate data location and queue names, then restart the Execution Engine to flush queued jobs memory.

update (select b.status from MTA_INTEG_BATCH b
	inner join mta_data_location d on b.o_datalocation = d.UUID
	where 
	b.status in ( 'SCHEDULED' , 'PENDING' )
	and d.name = '<your_datalocation_name>'
	and b.job_queue_name = '<your_queue_name>') t
set t.status ='DONE';

More important information about killing, suspending or resuming jobs:

Q: What is correct procedure to stop and purge jobs? Is killing Tomcat processes the only way?
A: When you stop tomcat, the engine that executes the jobs is stopped as well, because it's part of the application.

So the job does not continue with the rest of the queued tasks except after you restart the tomcat server.
Then, the restart behavior depends on the queue settings. You can have more details about this in the online help, focusing on the "Queue Behavior on Error part".

Q: Is there any way to “resume” a load?
A: The default behaviour is to restart a hung/suspended job where it was hung, so you don't have anything to do to resume the load. If you happen to get an Oracle error or if you choose to suspend, then you can restart a job. 

Q: How do I interact with a running job to cancel it?
A: The only possible interactions with a running job are found in the administration console --> Execution Engine perspective.

Q: How do I cancel everything – kill all jobs/tasks (as a last resort)? Especially because I submitted over 100 jobs in the queue and they are all blocked from running.
A: You can only stop the currently running job in the queue. The following "scheduled" jobs will stay in the queue, ready to be processed as soon as the queue is restarted.

The easiest way to "cancel" these queued jobs is to delete all the records from the SD table(s) that bear a LoadID greater than the LoadID of the current job.
The submitted jobs will be executed but won't have a single row to process.
Q: How do I cancel specific jobs – such as kill a single job without affecting other jobs (e.g. killing France load, without affecting UK and Italy ones)?
A: If the job is currently running: see video above. If it's not running yet: delete records in the SD table(s) or update B_LOADID to a dummy value like 0.

Q: How do I cancel (skip) a step in a specific job – such as skip processing the Party Address entity and let the rest of steps continue (this is unlikely, but it may be needed sometimes)?
A: This is not possible.

Q: How do I resume a specific job – e.g. suspend job, fix the data and resume it, restart it?
A: This is the default behavior. A suspended job can be canceled or restarted / resumed.
 
Q: Are there any other parameters which may affect the execution engine behavior?
A: Each queue has its own status. Read our support docs to find more information.
Q: I tried the above suggestions and nothing is working. I don't see anything suspended in the execution engine.  But when I stop the execution engine and start it again, my MDM process job is not showing.
A: Stop tomcat. Start tomcat. Restarting tomcat is the last resort but it will work effectively to get the execution engine going again. Make sure you don't have other users using xDM when you restart Tomcat or else you''ll boot them off.