LPS-29025

Hey Vili,

I made some changes and it should be OK now except the stale object exception what was fixed in theory in LPS-45232, but in reality I was able to find a use case (unfortunately our tests rely on this case...) when it still not working. I added this test to the code, please drop it once it works! I would like to ask you please manage the communication with the mentioned ticket's author/programmer to fix the problem and please re-test this ticket once the fix is ready. 

thanks,
Daniel