I have a multi-threaded map (Max Concurrent Map Instance 0, mercator.ini MaxThreads=20) that uses a DBQUERY to insert a record into an Oracle database table.
It is triggered by an MQ message arriving on a queue, and checks for the presence of a set of records in a source table. If the records are all present the map inserts them into the destination table. They are then deleted from the source table.
As the map is multi-threaded, a second instance of the map can sometimes be triggerred before the source records are deleted. This second instance tries to insert the same records, causing a primary key violation.
I have created a separate single-threaded (Max Concurrent Map Instance 1) submap that is a called using RUN to (1) check for the presence of the records in the destination table, (2) do the insert. This does not solve the problem. It seems like the secondary map is not truly single-threaded.
Any ideas?
It is triggered by an MQ message arriving on a queue, and checks for the presence of a set of records in a source table. If the records are all present the map inserts them into the destination table. They are then deleted from the source table.
As the map is multi-threaded, a second instance of the map can sometimes be triggerred before the source records are deleted. This second instance tries to insert the same records, causing a primary key violation.
I have created a separate single-threaded (Max Concurrent Map Instance 1) submap that is a called using RUN to (1) check for the presence of the records in the destination table, (2) do the insert. This does not solve the problem. It seems like the secondary map is not truly single-threaded.
Any ideas?