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

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

index 61d9658110d3ade5a797c6c8c39cad0f68cb4784..dd54b2408cfd7ee3e3291e136cc0eabfa7f58182 100644 (file)
@@ -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());