[mapguide-commits] r6176 - sandbox/adsk/2.2gp/Server/src/Services/Feature

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Oct 17 03:29:47 EDT 2011


Author: hubu
Date: 2011-10-17 00:29:47 -0700 (Mon, 17 Oct 2011)
New Revision: 6176

Modified:
   sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerFeatureService.cpp
   sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerFeatureService.h
   sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerSelectFeatures.cpp
   sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerSelectFeatures.h
Log:
On behalf of: Andy Zhang
Fix ticket 1728 in 2.2gp.

When executing command (by MgServerSelectFeatures or MgServerFeatureService.ExecuteSqlQuery), if fetch size is not specified, the DataCacheSize will be used as fetch size.

Modified: sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerFeatureService.cpp
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerFeatureService.cpp	2011-10-15 19:34:44 UTC (rev 6175)
+++ sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerFeatureService.cpp	2011-10-17 07:29:47 UTC (rev 6176)
@@ -62,6 +62,15 @@
 /// </summary>
 MgServerFeatureService::MgServerFeatureService() : MgFeatureService()
 {
+    // Get data cache size
+    MgConfiguration* config = MgConfiguration::GetInstance();
+    if(config)
+    {
+        config->GetIntValue(MgConfigProperties::FeatureServicePropertiesSection,
+                            MgConfigProperties::FeatureServicePropertyDataCacheSize,
+                            m_nDataCacheSize,
+                            MgConfigProperties::DefaultFeatureServicePropertyDataCacheSize);
+    }
 }
 
 //////////////////////////////////////////////////////////////////
@@ -691,8 +700,7 @@
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::ExecuteSqlQuery()");
 
-    MgServerSqlCommand sqlCommand;
-    return sqlCommand.ExecuteQuery(resource, sqlStatement, NULL, NULL);
+    return ExecuteSqlQuery(resource, sqlStatement, NULL, NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -737,8 +745,7 @@
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::ExecuteSqlQuery()");
 
-    MgServerSqlCommand sqlCommand;
-    return sqlCommand.ExecuteQuery(resource, sqlStatement, params, transaction);
+    return ExecuteSqlQuery(resource, sqlStatement, params, transaction, m_nDataCacheSize);
 }
 
 //////////////////////////////////////////////////////////////////

Modified: sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerFeatureService.h
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerFeatureService.h	2011-10-15 19:34:44 UTC (rev 6175)
+++ sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerFeatureService.h	2011-10-17 07:29:47 UTC (rev 6176)
@@ -989,6 +989,8 @@
         CREFSTRING schemaName, CREFSTRING className, REFSTRING schemaHash,
         Ptr<MgFeatureSchema>& schemaFound, Ptr<MgClassDefinition>& classFound);
     void FeatureSourceToString(MgResourceIdentifier* resource, string& resourceContent);
+
+    INT32 m_nDataCacheSize;
 };
 
 #endif

Modified: sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerSelectFeatures.cpp
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerSelectFeatures.cpp	2011-10-15 19:34:44 UTC (rev 6175)
+++ sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerSelectFeatures.cpp	2011-10-17 07:29:47 UTC (rev 6176)
@@ -51,10 +51,17 @@
     MgConfiguration* config = MgConfiguration::GetInstance();
     if(config)
     {
+        // Get the join batch size
         config->GetIntValue(MgConfigProperties::FeatureServicePropertiesSection,
                             MgConfigProperties::FeatureServicePropertyJoinQueryBatchSize,
                             m_nJoinQueryBatchSize,
                             MgConfigProperties::DefaultFeatureServicePropertyJoinQueryBatchSize);
+        // Get data cache size
+        config->GetIntValue(MgConfigProperties::FeatureServicePropertiesSection,
+                            MgConfigProperties::FeatureServicePropertyDataCacheSize,
+                            m_nDataCacheSize,
+                            MgConfigProperties::DefaultFeatureServicePropertyDataCacheSize);
+
     }
 }
 
@@ -370,10 +377,11 @@
 // Fetch size
 void MgServerSelectFeatures::ApplyFetchSize()
 {
-    CHECKNULL(m_options, L"MgServerSelectFeatures.ApplyFetchSize");
     CHECKNULL(m_command, L"MgServerSelectFeatures.ApplyFetchSize");
-
-    m_command->SetFetchSize(m_options->GetFetchSize());
+    if(m_options)
+        m_command->SetFetchSize(m_options->GetFetchSize());
+    else
+        m_command->SetFetchSize(m_nDataCacheSize);
 }
 
 // Spatial Filter

Modified: sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerSelectFeatures.h
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerSelectFeatures.h	2011-10-15 19:34:44 UTC (rev 6175)
+++ sandbox/adsk/2.2gp/Server/src/Services/Feature/ServerSelectFeatures.h	2011-10-17 07:29:47 UTC (rev 6176)
@@ -89,6 +89,8 @@
 
     // This setting limits the batch size used by the join query algorithm
     INT32 m_nJoinQueryBatchSize;
+
+    INT32 m_nDataCacheSize;
 };
 
 #endif



More information about the mapguide-commits mailing list