]> git.mxchange.org Git - jjobs-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:33:12 +0000 (21:33 +0200)
- explicitly flush after persisting to get id number in entity set

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

index a1cccd8e47113ee32d45b62356adf1ed78587471..31f565b1195c1c0c7853118efad2779653339b7f 100644 (file)
@@ -262,6 +262,9 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
                // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
                // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
                // Persist it
                this.getEntityManager().persist(mobileNumber);
 
+               // Flush it
+               this.getEntityManager().flush();
+
                // Find contact
                Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId());