[Registry-dev] svn commit r14855 - branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao

svn at wso2.org svn at wso2.org
Sun Mar 16 00:16:08 PDT 2008


Author: chathura
Date: Sun Mar 16 00:16:00 2008
New Revision: 14855

Log:


getCurrentVersionNumber() inside the getLatestVersion() is called twice with same path. This function call takes noticeable amount of time according to profiling results as multiple SQL statements are executed inside it. Removed the second call and used the result of first call for that. This may give some improvement as getLatestVersion() is called once per each resource get operation, which is most commonly used function.



Modified:
   branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java

Modified: branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
==============================================================================
--- branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java	(original)
+++ branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java	Sun Mar 16 00:16:00 2008
@@ -255,7 +255,7 @@
         // get resource children
         if (resource.isDirectory()) {
             String[] children = getLatestChildPaths(id,
-                                                    getCurrentVersionNumber(path, conn), conn);
+                                                    latestVersionNumber, conn);
             resource.setContent(children);
         } else {
             resource.setContent(new DBContentProxy(id, latestVersionNumber, dataSource));



More information about the Registry-dev mailing list