From 62b9ab615f08b19eb0aa7a534d634e936e2022ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 23 Aug 2016 17:09:52 +0200 Subject: [PATCH] Please cherry-pick: - explicitly flush after persisting to get id number in entity set --- .../phone/AddressbookAdminContactPhoneSessionBean.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java b/src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java index 00726f4..fa71e34 100644 --- a/src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java +++ b/src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java @@ -262,6 +262,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Persist it this.getEntityManager().persist(faxNumber); + // Flush it + this.getEntityManager().flush(); + // Find contact Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId()); @@ -322,6 +325,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Persist it this.getEntityManager().persist(landLineNumber); + // Flush it + this.getEntityManager().flush(); + // Find contact Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId()); @@ -376,6 +382,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseAddressbookData // Persist it this.getEntityManager().persist(mobileNumber); + // Flush it + this.getEntityManager().flush(); + // Find contact Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId()); -- 2.39.5