I just got this error because I was settingassigning an un-proxied entity don'tonto another entity before saving.
I should have been linking a proxied entity instance.
See the below explanation:
Child saved = childRepository.save(child); // INCORRECT parent.setChild(child); // <-- 'child' is NOT managed (not proxied) // CORRECT parent.setChild(saved); // <-- 'saved' is managed (proxied)