Author: bdaw
Date: 2011-08-16 06:52:15 -0400 (Tue, 16 Aug 2011)
New Revision: 7152
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
Log:
IDM performance - use hibernate flush instead of commit/begin
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-08-16
10:25:46 UTC (rev 7151)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-08-16
10:52:15 UTC (rev 7152)
@@ -236,7 +236,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
jbidGroup =
getIdentitySession().getPersistenceManager().
@@ -256,7 +256,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
Collection<org.picketlink.idm.api.Group> oneLevelChilds =
getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
null, true, false);
@@ -313,7 +313,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
allRoles = getIdentitySession().getRoleManager().findRoles(userName,
membershipType);
}
@@ -340,7 +340,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
groups =
getIdentitySession().getRelationshipManager().findAssociatedGroups(userName, null);
}
@@ -471,7 +471,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
plGroups.addAll(getIdentitySession().getRelationshipManager().
findAssociatedGroups(jbidGroup, null, true, false));
@@ -602,7 +602,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
allGroups =
getIdentitySession().getRelationshipManager().findRelatedGroups(user, null, null);
}
@@ -652,7 +652,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
plGroups
.addAll(getIdentitySession().getRelationshipManager().findAssociatedGroups(getRootGroup(),
null, true, true));
@@ -762,7 +762,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
}
@@ -887,7 +887,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
parents =
getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, false,
false);
}
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-08-16
10:25:46 UTC (rev 7151)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-08-16
10:52:15 UTC (rev 7152)
@@ -84,7 +84,7 @@
if (fullResults == null)
{
- userDAO.getOrgService().commitTransaction();
+ userDAO.getOrgService().flush();
userQueryBuilder.page(index, length);
UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
@@ -131,7 +131,7 @@
);
}
- userDAO.getOrgService().commitTransaction();
+ userDAO.getOrgService().flush();
int result;
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-08-16
10:25:46 UTC (rev 7151)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-08-16
10:52:15 UTC (rev 7152)
@@ -120,7 +120,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
if (g == null)
{
@@ -199,7 +199,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
String plGroupName = getPLIDMGroupName(getGroupNameFromId(m.getGroupId()));
@@ -281,7 +281,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
Membership m = new MembershipImpl(id);
@@ -381,7 +381,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
Collection<Role> roles = new HashSet();
@@ -478,7 +478,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
String plGroupName = getPLIDMGroupName(getGroupNameFromId(groupId));
@@ -571,7 +571,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
if (userName == null)
{
@@ -675,7 +675,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
Collection<Role> roles = new HashSet();
@@ -768,7 +768,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
String plGroupName = getPLIDMGroupName(getGroupNameFromId(groupId));
@@ -868,7 +868,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
Membership m = new MembershipImpl(id);
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2011-08-16
10:25:46 UTC (rev 7151)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2011-08-16
10:52:15 UTC (rev 7152)
@@ -166,7 +166,7 @@
}
- public void commitTransaction()
+ public void flush()
{
try
{
@@ -188,16 +188,10 @@
}
else
{
-
if (idmService_.getIdentitySession().getTransaction().isActive())
{
- idmService_.getIdentitySession().getTransaction().commit();
+ idmService_.getIdentitySession().save();
}
-
- if (!idmService_.getIdentitySession().getTransaction().isActive())
- {
- idmService_.getIdentitySession().beginTransaction();
- }
}
}
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-08-16
10:25:46 UTC (rev 7151)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-08-16
10:52:15 UTC (rev 7152)
@@ -144,7 +144,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
session.getPersistenceManager().createUser(user.getUserName());
}
@@ -215,7 +215,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
foundUser = session.getPersistenceManager().findUser(userName);
}
@@ -369,7 +369,7 @@
{
try
{
- orgService.commitTransaction();
+ orgService.flush();
IdentitySession session = service_.getIdentitySession();
org.picketlink.idm.api.User idmUser =
session.getPersistenceManager().findUser(user.getUserName());
@@ -473,7 +473,7 @@
}
}
- orgService.commitTransaction();
+ orgService.flush();
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
@@ -580,7 +580,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
plUser = session.getAttributesManager().findUserByUniqueAttribute(USER_EMAIL,
email);
}
@@ -653,7 +653,7 @@
public void persistUserInfo(User user, IdentitySession session) throws Exception
{
- orgService.commitTransaction();
+ orgService.flush();
AttributesManager am = session.getAttributesManager();
@@ -722,7 +722,7 @@
{
Object u = null;
- orgService.commitTransaction();
+ orgService.flush();
try
{
@@ -749,7 +749,7 @@
public void populateUser(User user, IdentitySession session) throws Exception
{
- orgService.commitTransaction();
+ orgService.flush();
AttributesManager am = session.getAttributesManager();