[mapguide-commits] r6649 - in trunk/MgDev: Common/MapGuideCommon/MapLayer Common/MapGuideCommon/Resources Common/MapGuideCommon/Services Server/src/Common/Manager

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue May 15 08:32:06 EDT 2012


Author: jng
Date: 2012-05-15 05:32:06 -0700 (Tue, 15 May 2012)
New Revision: 6649

Modified:
   trunk/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp
   trunk/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res
   trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp
   trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp
Log:
#531: Where applicable, add the offending session id to the error message of MgSessionExpiredException. This will make logged session expiry errors not only readable, but also traceable

Modified: trunk/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp	2012-05-15 12:17:46 UTC (rev 6648)
+++ trunk/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp	2012-05-15 12:32:06 UTC (rev 6649)
@@ -125,7 +125,7 @@
     if (userInfo.p != NULL) sessionId = userInfo->GetMgSessionId();
     if (sessionId.empty())
     {
-        throw new MgSessionExpiredException(L"MgSelection.Open",__LINE__,__WFILE__, NULL, L"", NULL);
+        throw new MgSessionExpiredException(L"MgSelection.Open",__LINE__,__WFILE__, NULL, L"MgSelectionOpenWithEmptySession", NULL);
     }
 
     Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(GetResourceName(sessionId, mapName));
@@ -143,7 +143,7 @@
     if (userInfo.p != NULL) sessionId = userInfo->GetMgSessionId();
     if (sessionId.empty())
     {
-        throw new MgSessionExpiredException(L"MgSelection.Save",__LINE__,__WFILE__, NULL, L"", NULL);
+        throw new MgSessionExpiredException(L"MgSelection.Save",__LINE__,__WFILE__, NULL, L"MgSelectionSaveWithEmptySession", NULL);
     }
 
     Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(GetResourceName(sessionId, mapName));

Modified: trunk/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res	2012-05-15 12:17:46 UTC (rev 6648)
+++ trunk/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res	2012-05-15 12:32:06 UTC (rev 6649)
@@ -308,6 +308,9 @@
 MgResourceTypesDifferent                              = The resource types cannot be different.
 MgResourcesIdentical                                  = The resources cannot be the same.
 MgSchemaNameMismatch                                  = This schema name does not match the one specified in the qualified class name '%1' provided.
+MgSessionExpired                                      = The session (%1) has expired.
+MgSelectionOpenWithEmptySession                       = Attempted to open a map selection with an empty or expired session id
+MgSelectionSaveWithEmptySession                       = Attempted to save a map selection with an empty or expired session id
 MgSiteServerIpMustNotBeLocalHost                      = The site server IP address must not be a local host.
 MgSqlReaderIdNotFound                                 = The SQL reader ID was not found.
 MgStringContainsReservedCharacters                    = The string cannot contain reserved characters %1

Modified: trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp	2012-05-15 12:17:46 UTC (rev 6648)
+++ trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp	2012-05-15 12:32:06 UTC (rev 6649)
@@ -334,7 +334,9 @@
             // This site is not currently working
 
             // We have a session, but it will not exist on any other machine so we force the session exception
-            throw new MgSessionExpiredException(L"MgSiteManager.GetConnectionProperties",__LINE__,__WFILE__, NULL, L"", NULL);
+            MgStringCollection args;
+            args.Add(sessionId);
+            throw new MgSessionExpiredException(L"MgSiteManager.GetConnectionProperties",__LINE__,__WFILE__, NULL, L"MgSessionExpired", &args);
         }
     }
     else

Modified: trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp	2012-05-15 12:17:46 UTC (rev 6648)
+++ trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp	2012-05-15 12:32:06 UTC (rev 6649)
@@ -112,8 +112,10 @@
 
     if (m_sessionInfoMap.end() == i)
     {
+        MgStringCollection args;
+        args.Add(session);
         throw new MgSessionExpiredException(L"MgSessionCache.RemoveSession",
-            __LINE__, __WFILE__, NULL, L"", NULL);
+            __LINE__, __WFILE__, NULL, L"MgSessionExpired", &args);
     }
     else
     {
@@ -171,8 +173,10 @@
     }
     else if (strict)
     {
+        MgStringCollection args;
+        args.Add(session);
         throw new MgSessionExpiredException(L"MgSessionCache.GetSessionInfo",
-            __LINE__, __WFILE__, NULL, L"", NULL);
+            __LINE__, __WFILE__, NULL, L"MgSessionExpired", &args);
     }
 
     return sessionInfo;



More information about the mapguide-commits mailing list