the PK for the BATCH_NIFI_JOB table should be just the FLOW_FILE_ID.
It should not include the EVENT_ID
Databases starting prior to 0.8 will have the Primary Key using the FLOW_FILE_ID and EVENT_ID.
Databases starting with 0.8 will not have a Primary Key
When processing events with multiple jms listeners you can run into a situation where 2 threads insert the same flowfile for a new job.
This needs to be handled with a unique key constraint on the incoming flowfile that is trying to create the new job execution.