Merged DEV/JASONH to HEAD

12170: (Partial) Performance improvement (ALFCOM-1507) in getBaseVersion()
  12622: JCR - add test for ALFCOM-1507 performance improvement


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12653 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-01-09 12:58:09 +00:00
parent 4c800c25c5
commit 0f51b06274
3 changed files with 126 additions and 2 deletions

View File

@@ -1035,7 +1035,15 @@ public class NodeImpl extends ItemImpl implements Node
// construct version
VersionService versionService = session.getRepositoryImpl().getServiceRegistry().getVersionService();
org.alfresco.service.cmr.version.VersionHistory versionHistory = versionService.getVersionHistory(nodeRef);
org.alfresco.service.cmr.version.Version version = versionService.getCurrentVersion(nodeRef);
// This patch halves the time this method takes to execute. Implements ALFCOM-1507
// org.alfresco.service.cmr.version.Version version = versionService.getCurrentVersion(nodeRef);
org.alfresco.service.cmr.version.Version version = null;
if (versionHistory != null)
{
String versionLabel = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_VERSION_LABEL);
version = versionHistory.getVersion(versionLabel);
}
return new VersionImpl(new VersionHistoryImpl(session, versionHistory), version).getProxy();
}