We are writing a trigger on update of DB2 table which will CALL stored procedure and pass values from the table to stored procedure and the stored procedure will process the data and update IMS using AERTDLI call.

Problems we are facing
When one record is updated and then commit it works fine, If we do more than 1 update then commit unit of work the update to first record is successful in IMS but when stored procedure is called for updating second record the whole unit of work hangs which is causing lingering thread.

If we can find out how to avoid multiple threads for each updates in IMS and make sure we have only one thread for multiple updates which will resolve this issue.