[mapguide-commits] r6110 - in trunk/MgDev: Common/MapGuideCommon/System Server/src/Common/Manager Server/src/Core

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Sep 1 23:42:31 EDT 2011


Author: christinebao
Date: 2011-09-01 20:42:31 -0700 (Thu, 01 Sep 2011)
New Revision: 6110

Modified:
   trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
   trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
   trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
   trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.h
   trunk/MgDev/Server/src/Core/serverconfig.ini
Log:
Fix ticket http://trac.osgeo.org/mapguide/ticket/1793
AIMS hang when foreign WMS is not available anymore
The config is based on provider, such as OSGeo.WMS:120,OSGeo.SDF:50

Modified: trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp	2011-09-01 19:52:59 UTC (rev 6109)
+++ trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp	2011-09-02 03:42:31 UTC (rev 6110)
@@ -274,8 +274,8 @@
 const INT32  MgConfigProperties::DefaultFeatureServicePropertyDataTransactionTimeout        = 360;
 const STRING MgConfigProperties::FeatureServicePropertyDataTransactionTimerInterval         = L"DataTransactionTimerInterval";
 const INT32  MgConfigProperties::DefaultFeatureServicePropertyDataTransactionTimerInterval  = 60;
-const STRING MgConfigProperties::FeatureServicePropertyFDOConnectionTimeout                 = L"FDOConnectionTimeout";
-const INT32  MgConfigProperties::DefaultFeatureServicePropertyFDOConnectionTimeout          = 120;
+const STRING MgConfigProperties::FeatureServicePropertyFDOConnectionTimeoutCustom           = L"FDOConnectionTimeoutCustom";
+const STRING MgConfigProperties::DefaultFeatureServicePropertyFDOConnectionTimeoutCustom    = L"OSGeo.WMS:120";
 
 // ******************************************************************
 // Mapping Service Properties
@@ -649,7 +649,7 @@
     { MgConfigProperties::FeatureServicePropertyDataConnectionUseLimit              , MgPropertyType::String    , MG_CONFIG_MIN_FS_CP_EXCLUDED_LENGTH   , MG_CONFIG_MAX_FS_CP_EXCLUDED_LENGTH   , L""                                       },
     { MgConfigProperties::FeatureServicePropertyDataTransactionTimeout              , MgPropertyType::Int32     , MG_CONFIG_MIN_TIMEOUT                 , MG_CONFIG_MAX_TIMEOUT                 , L""                                       },
     { MgConfigProperties::FeatureServicePropertyDataTransactionTimerInterval        , MgPropertyType::Int32     , MG_CONFIG_MIN_TIMER_INTERVAL          , MG_CONFIG_MAX_TIMER_INTERVAL          , L""                                       },
-    { MgConfigProperties::FeatureServicePropertyFDOConnectionTimeout                , MgPropertyType::Int32     , 1                                     , 600                                   , L""                                       },
+    { MgConfigProperties::FeatureServicePropertyFDOConnectionTimeoutCustom          , MgPropertyType::String    , MG_CONFIG_MIN_FS_CP_EXCLUDED_LENGTH   , MG_CONFIG_MAX_FS_CP_EXCLUDED_LENGTH   , L""                                       },
     { L""                                                                           , 0                         , 0.0                                   , 0.0                                   , L""                                       }
 };
 

Modified: trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h	2011-09-01 19:52:59 UTC (rev 6109)
+++ trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h	2011-09-02 03:42:31 UTC (rev 6110)
@@ -340,8 +340,8 @@
     static const INT32 DefaultFeatureServicePropertyDataTransactionTimerInterval;/// value(60)
 
     /// Set the time duration in seconds for an FDO connection
-    static const STRING FeatureServicePropertyFDOConnectionTimeout;              /// value("FDOConnectionTimeout")
-    static const INT32 DefaultFeatureServicePropertyFDOConnectionTimeout;        /// value(120)
+    static const STRING FeatureServicePropertyFDOConnectionTimeoutCustom;        /// value("FDOConnectionTimeoutCustom")
+    static const STRING DefaultFeatureServicePropertyFDOConnectionTimeoutCustom; /// value("OSGeo.WMS:120")
 
     /// MAPPING SERVICE PROPERTIES SECTION -------------------------------------------------------------------------------
 

Modified: trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2011-09-01 19:52:59 UTC (rev 6109)
+++ trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2011-09-02 03:42:31 UTC (rev 6110)
@@ -263,7 +263,7 @@
             pFdoConnection = m_connManager->CreateConnection(provider.c_str());
 
             // Check if the connection support timeout setting
-            SetConnectionTimeout(pFdoConnection);
+            SetConnectionTimeout(pFdoConnection, provider);
 
             // Check if we have thread model
             if((FdoThreadCapability)-1 == providerInfo->GetThreadModel())
@@ -385,7 +385,7 @@
             pFdoConnection = m_connManager->CreateConnection(providerNoVersion.c_str());
 
             // Check if the connection support timeout setting
-            SetConnectionTimeout(pFdoConnection);
+            SetConnectionTimeout(pFdoConnection, providerNoVersion);
 
             // Check if we have thread model
             if((FdoThreadCapability)-1 == providerInfo->GetThreadModel())
@@ -785,25 +785,49 @@
         }
 }
 
-void MgFdoConnectionManager::SetConnectionTimeout(FdoIConnection* pFdoConnection)
+void MgFdoConnectionManager::SetConnectionTimeout(FdoIConnection* pFdoConnection, STRING providerName)
 {
     FdoPtr<FdoIConnectionCapabilities> connectionCapabilities = pFdoConnection->GetConnectionCapabilities();
     if(connectionCapabilities->SupportsTimeout())
     {
         MgConfiguration* configuration = MgConfiguration::GetInstance();
         ACE_ASSERT(NULL != configuration);
-        INT32 timeout = MgConfigProperties::DefaultFeatureServicePropertyFDOConnectionTimeout;
+        STRING timeoutCustom = MgConfigProperties::DefaultFeatureServicePropertyFDOConnectionTimeoutCustom;
         if (NULL != configuration)
         {
-            configuration->GetIntValue(
+            configuration->GetStringValue(
                 MgConfigProperties::FeatureServicePropertiesSection,
-                MgConfigProperties::FeatureServicePropertyFDOConnectionTimeout,
-                timeout,
-                MgConfigProperties::DefaultFeatureServicePropertyFDOConnectionTimeout);
+                MgConfigProperties::FeatureServicePropertyFDOConnectionTimeoutCustom,
+                timeoutCustom,
+                MgConfigProperties::DefaultFeatureServicePropertyFDOConnectionTimeoutCustom);
         }
-        if(timeout > 0)
+        if(timeoutCustom.length() > 0)
         {
-            pFdoConnection->SetConnectionTimeout(timeout);
+            Ptr<MgStringCollection> fdoTimeoutCol = MgStringCollection::ParseCollection(timeoutCustom, L",");  // NOXLATE
+            // Update the fdo connection timeout value
+            if (fdoTimeoutCol.p)
+            {
+                for(INT32 i=0;i<fdoTimeoutCol->GetCount();i++)
+                {
+                    STRING fdoTimeoutCustom = fdoTimeoutCol->GetItem(i);
+                    STRING provider = L"";  // NOXLATE
+                    INT32 timeoutVal = 120;
+                    // Parse the format: provider:timeoutVal
+                    // Example: OSGeo.WMS:120
+                    Ptr<MgStringCollection> customCol = MgStringCollection::ParseCollection(fdoTimeoutCustom, L":");  // NOXLATE
+                    if(customCol->GetCount() == 2)
+                    {
+                        provider = customCol->GetItem(0);
+                        STRING value = customCol->GetItem(1);
+                        timeoutVal = MgUtil::StringToInt32(value);
+                    }                    
+                    if(provider.find(providerName) != STRING::npos && timeoutVal > 0)
+                    {
+                        pFdoConnection->SetConnectionTimeout(timeoutVal);
+                        break;
+                    }
+                }
+            }
         }
     }
 }

Modified: trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.h
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.h	2011-09-01 19:52:59 UTC (rev 6109)
+++ trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.h	2011-09-02 03:42:31 UTC (rev 6110)
@@ -253,7 +253,7 @@
     void SetConfiguration(CREFSTRING provider, FdoIConnection* pFdoConnection, MgResourceIdentifier* resourceIdentifier, STRING& configDataName);
     void SetConnectionProperties(FdoIConnection* pFdoConnection, MdfModel::FeatureSource* pFeatureSource);
 
-    void SetConnectionTimeout(FdoIConnection* pFdoConnection);
+    void SetConnectionTimeout(FdoIConnection* pFdoConnection, STRING providerName);
 
     void ActivateSpatialContext(FdoIConnection* pFdoConnection, STRING& spatialContextName);
     void ActivateLongTransaction(FdoIConnection* pFdoConnection, STRING& longTransactionName);

Modified: trunk/MgDev/Server/src/Core/serverconfig.ini
===================================================================
--- trunk/MgDev/Server/src/Core/serverconfig.ini	2011-09-01 19:52:59 UTC (rev 6109)
+++ trunk/MgDev/Server/src/Core/serverconfig.ini	2011-09-02 03:42:31 UTC (rev 6110)
@@ -280,7 +280,7 @@
 JoinQueryBatchSize                 = 1000
 DataTransactionTimeout             = 360
 DataTransactionTimerInterval       = 60
-FDOConnectionTimeout               = 120
+FDOConnectionTimeoutCustom         = OSGeo.WMS:120
 
 [MappingServiceProperties]
 # *****************************************************************************



More information about the mapguide-commits mailing list