[mapguide-commits] r6648 - in branches/2.4/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:17:47 EDT 2012


Author: jng
Date: 2012-05-15 05:17:46 -0700 (Tue, 15 May 2012)
New Revision: 6648

Modified:
   branches/2.4/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp
   branches/2.4/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res
   branches/2.4/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp
   branches/2.4/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: branches/2.4/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp
===================================================================
--- branches/2.4/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp	2012-05-14 16:08:26 UTC (rev 6647)
+++ branches/2.4/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp	2012-05-15 12:17:46 UTC (rev 6648)
@@ -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: branches/2.4/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res
===================================================================
--- branches/2.4/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res	2012-05-14 16:08:26 UTC (rev 6647)
+++ branches/2.4/MgDev/Common/MapGuideCommon/Resources/mapguide_en.res	2012-05-15 12:17:46 UTC (rev 6648)
@@ -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: branches/2.4/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp
===================================================================
--- branches/2.4/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp	2012-05-14 16:08:26 UTC (rev 6647)
+++ branches/2.4/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp	2012-05-15 12:17:46 UTC (rev 6648)
@@ -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: branches/2.4/MgDev/Server/src/Common/Manager/SessionCache.cpp
===================================================================
--- branches/2.4/MgDev/Server/src/Common/Manager/SessionCache.cpp	2012-05-14 16:08:26 UTC (rev 6647)
+++ branches/2.4/MgDev/Server/src/Common/Manager/SessionCache.cpp	2012-05-15 12:17:46 UTC (rev 6648)
@@ -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