What doesn't change?
Did you try to debug to see what is happening behind? That would be the best to you to do because that way you can see if you are passing all the values you need to update the record that you are checking.
It can be many things, it can be that you are not passing the right record...
It can also be your reference data, like, if you say the variable present is unique for each training, you need to see if the way you have your entities is correct, I don't know if you have 1-n or n-m if is an n-m it means you will need a third table to make it unique for each record in each train, my guess.
Can you share your OML?