I just got this error because I was setting an un-managed, un-proxied bean.
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)