IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST

Hello,
I am trying to insert data in two entities at the same time, but on certain occasions it gives the error of “IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST:” and I don’t really know how to fix it, I would greatly appreciate your help.