]
Khoi Nguyen reassigned GTNPORTAL-1914:
--------------------------------------
Assignee: Khoi Nguyen
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: portal-s54
Fix For: 3.2.0-GA
Original Estimate: 4 hours
Remaining Estimate: 4 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: