From: Roland Häder Date: Tue, 23 Aug 2016 15:09:52 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3f75601d74c247141df40218d9282cf0582e9446;p=pizzaservice-ejb.git Please cherry-pick: - explicitly flush after persisting to get id number in entity set --- diff --git a/src/java/org/mxchange/jcontacts/phone/PizzaAdminContactPhoneSessionBean.java b/src/java/org/mxchange/jcontacts/phone/PizzaAdminContactPhoneSessionBean.java index 61d9658..dd54b24 100644 --- a/src/java/org/mxchange/jcontacts/phone/PizzaAdminContactPhoneSessionBean.java +++ b/src/java/org/mxchange/jcontacts/phone/PizzaAdminContactPhoneSessionBean.java @@ -262,6 +262,9 @@ public class PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // 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 PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean imp // Persist it this.getEntityManager().persist(mobileNumber); + // Flush it + this.getEntityManager().flush(); + // Find contact Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId());