と の 2 つのオブジェクトがUserありResumeます。履歴書にはUser userフィールドがあります。私のコードでは、まずuserオブジェクトを取得し、それにいくつかの変更を加えます。が存在する場合はResume.findByUser(user)、履歴書を取得し、そこでもいくつかの変更を行います。
を呼び出しuser.save()てresume.save()、セッション内に同じオブジェクトへの別の参照があるという例外が発生した場合、merge().
データを呼び出すuser.merge()と保存されますが、呼び出すresume.merge()と次の例外が発生します。
org.springframework.dao.DuplicateKeyException: a different object with the same identifier value was already associated with the session: [com.wizard.security.User#36]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.wizard.security.User#36]
どうしたらいいのかわからない。resume.userと同じオブジェクトを参照するオブジェクトに問題があるようuserです。
この問題についてお役に立てれば幸いです。ありがとうございます。