Hi All,
I am using MNI to start my sub process for each Id passed through Interface (Action) , which is configured as "Run all instances at the same time" .
My sub process has "write to data store entity" so for each Id it will go to database and insert a new row . This result in error as "Deadlock found when trying to get lock; try restarting transaction" . How do i resolve this issue ?
Any pointers will help ?
Thanks in Advance
Discussion posts and replies are publicly visible
try with this options as mentioned in image ,in " Run one instance for each item in" specify your array
This didn't help. Thanks for the response .
Again you are getting same issue?
if possible can you share MNI configuration screen shot as i attached.
Yes, same issue . Please find screenshot below .
is pv!selectedTickerId is an array which you want to save ?
yes pv!selectedTickerId is an array
Try with Spawn New option
Since you are running all children at the same time, each child process is trying to hit the same database table at the exact same time, resulting in a lock preventing all writes from happening. Some ideas:
1) Why are you using MNI for this? Depending on what else is in the child process model, you could try to write all the rows in one transaction, eliminating the need for MNI altogether.
2) Can you simply run them one at a time to avoid the issue?
Agree with Steve. You need to look at your design and business need1. You could select run instances one at a time but might be a problem if the model has a user input task, or is too long, or..2. You could do the write to DB before you hit the MNI, moving the write up and do in bulk, by using a write to DS with a multi cdt or call a stored proc to do the eval, manipulation, and writes, then do the min based on the PKs returned3. or...Hope this gives you some ideas.