On Wed, Mar 10, 2010 at 12:02 AM, Arjun Nair <[email protected]> wrote: > Of the late, I have noticed that saving users or groups always takes a long > time (sometimes 30 secs or greater depending on how many users there are). > After digging through the code, I came upon the CoreContextImpl.onSave() > event listener. Every time you save a group (a group save is also triggered > when you save users), this function goes through the list of users in that > group, sets their branch, and saves them back to the database. This seems > very inefficient. Any reason we do it this way? I think we should this > differently.
This is part of my commit: http://code.sipfoundry.org/changelog/sipXecs/?cs=17717 from issue: XX-7216: Users fails to inherit the "Branch" name when added to the User Group configured with "Branch". Users should inherit associated group's branch, and this is why I made sure that the user branch is always correctly inherited: when you save groups (the group branch should be propagated to member user branch) or when you save users (user branch should be the same as associated group branch) It looks that it was a bad solution that brings unwanted overhead. This should be definitely changed. One possible fix would be to change the strategy here. Never perform saving/update when group/member user branches does not match. Display an error message instead of forcing group/member user branch to match. If we try to group users with different branches to a group with different branch - prompt an error message. If we try to change the branch of an user that belongs to a group with different branch, also prompt an error message. Thanks for noticing this, Mircea > > Arjun > _______________________________________________ > sipx-dev mailing list [email protected] > List Archive: http://list.sipfoundry.org/archive/sipx-dev > Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev > sipXecs IP PBX -- http://www.sipfoundry.org/ > _______________________________________________ sipx-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipx-dev Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev sipXecs IP PBX -- http://www.sipfoundry.org/
