[gatein-issues] [JBoss JIRA] Resolved: (GTNPORTAL-1914) OrganizationService lifecycle (and Hibernate transaction) always started in CacheUserProfileFilter during HTTP request of anonymous user

Minh Hoang TO (JIRA) jira-events at lists.jboss.org
Mon Jul 4 22:52:23 EDT 2011


     [ https://issues.jboss.org/browse/GTNPORTAL-1914?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Minh Hoang TO resolved GTNPORTAL-1914.
--------------------------------------

    Resolution: Done


> OrganizationService lifecycle (and Hibernate transaction) always started in CacheUserProfileFilter during HTTP request of anonymous user
> ----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GTNPORTAL-1914
>                 URL: https://issues.jboss.org/browse/GTNPORTAL-1914
>             Project: GateIn Portal
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.1.0-GA
>            Reporter: Marek Posolda
>            Assignee: Khoi Nguyen
>              Labels: done, portal-s54
>             Fix For: 3.2.0-M02
>
>   Original Estimate: 4 hours
>          Time Spent: 1 hour
>  Remaining Estimate: 0 minutes
>
> In version of SetCurrentIdentityFilter.java from eXo core 2.3.X (version used in GateIn and EPP) is ConversationState for anonymous user not created . But problem is that in eXo core 2.4.0-GA-SNAPSHOT is ConversationState always created even for anonymous user because of EXOJCR-779 . And this is causing performance problem in CacheUserProfileFilter.java :
> {code}
> if (state != null)
> {
>           if (state.getAttribute(USER_PROFILE) == null)
>           {
>              OrganizationService orgService =
>                 (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
>              begin(orgService);
>              User user = orgService.getUserHandler().findUserByName(state.getIdentity().getUserId());
>              end(orgService);
>              state.setAttribute(USER_PROFILE, user);
>           }
> }
> {code}
> When we are using eXo core 2.4.0, then ConversationState is never null, which means that the inner clausule is always called, which means expensive start of Hibernate transaction (And this is not good for performance). This is called for every HTTP request of anonymous user, because User is never found and so that statement: "state.getAttribute(USER_PROFILE) == null" is always true.
> Possible workaround can be use something like: 
> {code}
> if (state != null && !IdentityConstants.ANONIM.equals(state.getIdentity().getUserId()))
> {code}
> in CacheUserProfileFilter.java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the gatein-issues mailing list