From a340044edf029c01f98a4041f21cafb0a82c6d38 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 26 Aug 2016 17:04:33 +0200 Subject: [PATCH] Please cherry-pick: - use find() and and not getReference()/merge() --- .../database/BaseAddressbookDatabaseBean.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java b/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java index f515d53..40c905f 100644 --- a/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java +++ b/src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java @@ -308,16 +308,13 @@ public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean { } // Get contact from it and find it - Contact foundContact = this.getEntityManager().getReference(detachedContact.getClass(), detachedContact.getContactId()); + Contact managedContact = this.getEntityManager().find(detachedContact.getClass(), detachedContact.getContactId()); // Should be found - assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", detachedContact.getContactId()); //NOI18N + assert (managedContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", detachedContact.getContactId()); //NOI18N // Debug message - this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateUserPersonalData: foundContact.contactId={1}", this.getClass().getSimpleName(), foundContact.getContactId())); //NOI18N - - // Merge contact instance - Contact managedContact = this.getEntityManager().merge(foundContact); + this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateUserPersonalData: managedContact.contactId={1}", this.getClass().getSimpleName(), managedContact.getContactId())); //NOI18N // Is a fax number set? if (detachedContact.getContactFaxNumber() instanceof DialableFaxNumber) { -- 2.39.5