[mapguide-commits] r1128 - trunk/MgDev/Server/src/Services/Resource

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Feb 22 15:42:18 EST 2007


Author: stevedang
Date: 2007-02-22 15:42:18 -0500 (Thu, 22 Feb 2007)
New Revision: 1128

Modified:
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
Log:
Performance - Optimize resource service to reduce the number of "Repository was busy" exceptions thrown when deadlocks occur.

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2007-02-22 19:51:00 UTC (rev 1127)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2007-02-22 20:42:18 UTC (rev 1128)
@@ -27,7 +27,7 @@
 #include "SiteResourceContentManager.h"
 #include "UnmanagedDataManager.h"
 
-const int MgServerResourceService::sm_maxOpRetries = 3;
+const int MgServerResourceService::sm_maxOpRetries = 10;
 
 MgSiteRepository*    MgServerResourceService::sm_siteRepository    = NULL;
 MgSessionRepository* MgServerResourceService::sm_sessionRepository = NULL;
@@ -40,6 +40,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 /// Server Resource Service retry macros.
+/// This pauses briefly (about 10 ms) before trying the operation again.
 ///
 #define MG_RESOURCE_SERVICE_BEGIN_OPERATION(transacted)                       \
     int numRetries = 0;                                                       \
@@ -78,6 +79,9 @@
         {                                                                     \
             throw;                                                            \
         }                                                                     \
+                                                                              \
+        ACE_Time_Value timeValue(0, 10000);                                   \
+        ACE_OS::sleep(timeValue);                                             \
     }                                                                         \
                                                                               \
     repositoryMan->Terminate();                                               \
@@ -1809,7 +1813,7 @@
 ///----------------------------------------------------------------------------
 
 MgByteReader* MgServerResourceService::EnumerateUnmanagedData(
-	CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
+    CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
 {
     Ptr<MgByteReader> byteReader;
 



More information about the mapguide-commits mailing list