]> git.mxchange.org Git - pizzaservice-mailer-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Tue, 23 Aug 2016 15:09:52 +0000 (17:09 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 9 Jun 2017 20:09:22 +0000 (22:09 +0200)
- explicitly flush after persisting to get id number in entity set

src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java

index 00726f4cec4e61989455df0ef3cf10d329322817..fa71e3403db6ec24439676f1a80c0e5e65df5c7c 100644 (file)
@@ -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());