From: Roland Häder Date: Tue, 10 May 2016 13:42:50 +0000 (+0200) Subject: use found contact, not merge() (SQL update statement) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=618110417390969f9ff879fe11106a86a8354d7b;p=jjobs-ejb.git use found contact, not merge() (SQL update statement) Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java index 81d82cd..68a8085 100644 --- a/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java @@ -561,11 +561,8 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes // Try to find the contact instance Contact foundContact = this.getEntityManager().find(user.getUserContact().getClass(), user.getUserContact().getContactId()); - // Try to merge it - Contact detachedContact = this.getEntityManager().merge(foundContact); - - // Set it in user - user.setUserContact(detachedContact); + // Set detached object in rexcruiter instance + user.setUserContact(foundContact); // Persist user this.getEntityManager().persist(user);