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

Khoi Nguyen (JIRA) jira-events at lists.jboss.org
Tue Jun 7 06:29:59 EDT 2011


     [ https://issues.jboss.org/browse/GTNPORTAL-1914?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel\#worklog-{worklog.getId()} ]

Khoi Nguyen logged work on GTNPORTAL-1914:
------------------------------------------

                Author: Khoi Nguyen
            Created on: 07/Jun/11 6:28 AM
            Start Date: 07/Jun/11 6:27 AM
    Worklog Time Spent: 1 hour 

Issue Time Tracking
-------------------

    Remaining Estimate: 3 hours  (was: 4 hours)
            Time Spent: 1 hour
            Worklog Id:     (was: 12424407)


> 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-GA
>
>   Original Estimate: 4 hours
>          Time Spent: 1 hour
>  Remaining Estimate: 3 hours
>
> 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