From: Roland Häder Date: Wed, 19 Apr 2017 23:28:26 +0000 (+0200) Subject: Let's don't call EJBs to often to have best performance X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=20974fa3fcf8614a7f9fd7486b774e0d434859d0;p=addressbook-war.git Let's don't call EJBs to often to have best performance Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java index 5b412444..7ef8d3fb 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java @@ -40,6 +40,8 @@ import org.mxchange.jcontacts.contact.ContactSessionBeanRemote; import org.mxchange.jcontacts.contact.UserContact; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcontacts.contact.utils.ContactUtils; +import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; +import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; import org.mxchange.jcontacts.exceptions.ContactNotFoundException; import org.mxchange.jcountry.data.Country; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; @@ -49,15 +51,13 @@ import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; -import org.mxchange.jusercore.exceptions.UserPasswordMismatchException; -import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent; import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent; import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent; -import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; -import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; +import org.mxchange.jusercore.exceptions.UserPasswordMismatchException; +import org.mxchange.jusercore.model.user.User; /** * A general contact bean (controller) @@ -833,15 +833,15 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController // Get full email address list for reducing EJB calls this.emailAddressList.addAll(this.contactBean.getEmailAddressList()); + // Get all contacts + List allContacts = this.contactBean.getAllContacts(); + // Get full contact list - this.contactList.addAll(this.contactBean.getAllContacts()); + this.contactList.addAll(allContacts); // Get all users List allUsers = this.userController.allUsers(); - // Get all contacts - List allContacts = this.contactBean.getAllContacts(); - // Get iterator Iterator iterator = allContacts.iterator();