[JBoss JIRA] Created: (JBPORTAL-1708) Identity APIs should invalidate cache on update/change of role membership
by Andrew Oliver (JIRA)
Identity APIs should invalidate cache on update/change of role membership
-------------------------------------------------------------------------
Key: JBPORTAL-1708
URL: http://jira.jboss.com/jira/browse/JBPORTAL-1708
Project: JBoss Portal
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Portal Identity
Affects Versions: 2.6.1 Final
Reporter: Andrew Oliver
Consider this code:
String username = request.getParameter("username");
User user= usermodule.findUserByUserName(username);
System.err.println("user was equal to "+(user == null ? "null" : user.getUserName()));
Role role = rolemodule.findRoleByName("approved");
Set users = new HashSet();
users.add(user);
membership.assignUsers(role, users);
And this code:
Role roleApproved = rolemodule.findRoleByName("approved");
Set usersApproved = membership.getUsers(roleApproved);
With the default Hibernate settings for identity in server\default\deploy\jboss-portal.sar\conf\hibernate\user\hibernate.cfg.xml:
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
The second bit of code doesn't see changes by the first bit of code until the portal is restarted (it seems).
Switching these to false solves the problem. It is likely that this is due to the HibernateMembershipModuleImpl and the <set
name="roles"
table="jbp_role_membership"
lazy="false"
inverse="false"
cascade="none"
sort="unsorted">
<cache usage="read-write"/>
<key column="jbp_uid"/>
<many-to-many
class="org.jboss.portal.identity.db.HibernateRoleImpl"
column="jbp_rid"
outer-join="true"/>
</set>
which specifies a cached collection and in http://viewvc.jboss.org/cgi-bin/viewvc.cgi/portal/branches/JBoss_Portal_B...
public void assignRoles(User user, Set roles) throws IdentityException
{
//throw new UnsupportedOperationException("Not yet implemented");
if (!(user instanceof HibernateUserImpl))
{
throw new IllegalArgumentException("User is not a HibernateUserImpl user");
}
// We make a defensive copy with unwrapped maps and update with a new set
Set copy = new HashSet();
for (Iterator i = roles.iterator(); i.hasNext();)
{
Object o = i.next();
if (o instanceof HibernateRoleImpl)
{
copy.add(o);
}
else
{
throw new IllegalArgumentException("Only HibernateRoleImpl roles can be accepted");
}
}
// Assign new roles
HibernateUserImpl ui = (HibernateUserImpl)user;
ui.setRoles(copy);
}
The defensive copy which avoids the hibernate collection probably prevents triggering of the cache invalidation logic in the many-many relationship (not 100% sure that this is how hibernate works for collection caching but it seems logical).
The hibernate membership module's usage of hibernate is a bit odd and probably needs review anyhow.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 6 months
[JBoss JIRA] Created: (JBPORTAL-1493) Separate internal configuration state (DB / LDAP) from the exposed meta data of the property
by Julien Viet (JIRA)
Separate internal configuration state (DB / LDAP) from the exposed meta data of the property
--------------------------------------------------------------------------------------------
Key: JBPORTAL-1493
URL: http://jira.jboss.com/jira/browse/JBPORTAL-1493
Project: JBoss Portal
Issue Type: Task
Security Level: Public (Everyone can see)
Components: Portal Identity
Reporter: Julien Viet
Assigned To: Boleslaw Dawidowicz
Fix For: 2.8 Final
For example :
public String getName();
public String getType();
public String getAccessMode();
public String getUsage();
public LocalizedString getDisplayName();
public LocalizedString getDescription();
is what client of the API will care about.
public String getMappingDBType();
public String getMappingLDAPValue();
public String getMappingDBValue();
public boolean isMappedDB();
public boolean isMappedLDAP();
is an internal implementation detail that the client should not know about, as it is part of the configuration of the property, not the usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 6 months
[JBoss JIRA] Created: (JBPORTAL-1343) Create an Ant task to execute a TestDriver
by Julien Viet (JIRA)
Create an Ant task to execute a TestDriver
------------------------------------------
Key: JBPORTAL-1343
URL: http://jira.jboss.com/jira/browse/JBPORTAL-1343
Project: JBoss Portal
Issue Type: Task
Security Level: Public (Everyone can see)
Reporter: Julien Viet
Fix For: 2.8 Final
An org.jboss.portal.common.test.driver.TestDriver is executed in Ant though the usage of the org.jboss.portal.common.test.junit.JUnitAdapter which adaps the TestDriver protocol to junit.
It has several limitations :
- the way to pass parameters to the test driver is convoluted and basically an hack (that works)
- it is not possible to filter the set of tests returned by the TestDriver easily which force many times to create subclasses in order to execute each test separately
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 6 months
[JBoss JIRA] Created: (JBMICROCONT-118) Fix the introspection assumption in ClassInfo
by Adrian Brock (JIRA)
Fix the introspection assumption in ClassInfo
---------------------------------------------
Key: JBMICROCONT-118
URL: http://jira.jboss.com/jira/browse/JBMICROCONT-118
Project: JBoss MicroContainer
Issue Type: Task
Components: BeanInfo
Affects Versions: JBossMC_2_0_0 Beta
Reporter: Adrian Brock
Priority: Minor
Fix For: JBossMC_2_0_0_CR1
Although the javassist version of the ClassInfo works fine, there are still some places
in the base ClassInfoImpl that assume introspection (i.e. java.lang.reflect objects).
The javassist impl works around these issues by subclassing.
Additionally, the deprecated ClassInfo.getType() needs removing.
This will require understanding where it is currently used and fixing it
(I think it is mainly related to determining the classloader?)
Moving this method and its dependencies to the ReflectClassInfoImpl
Whether we actually remove the deprecated method is another issue
since it is useful to temporarily fix problems (in future) where we don't provide an equivalent
in the ClassInfo api.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 6 months