[mapguide-commits] r4290 - in sandbox/adsk/2.1/Server/src: Common/Base UnitTesting

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Oct 7 17:10:32 EDT 2009


Author: brucedechant
Date: 2009-10-07 17:10:32 -0400 (Wed, 07 Oct 2009)
New Revision: 4290

Modified:
   sandbox/adsk/2.1/Server/src/Common/Base/ServiceOperation.cpp
   sandbox/adsk/2.1/Server/src/UnitTesting/TestKmlService.cpp
   sandbox/adsk/2.1/Server/src/UnitTesting/TestMappingService.cpp
   sandbox/adsk/2.1/Server/src/UnitTesting/TestRenderingService.cpp
   sandbox/adsk/2.1/Server/src/UnitTesting/TestTileService.cpp
Log:
Fix for trac ticket 1110 - Stability improvements
http://trac.osgeo.org/mapguide/ticket/1110

Notes:
- Update usage of SetCurrentUserInfo() because of the TLS now having a copy of the MgUserInformation


Modified: sandbox/adsk/2.1/Server/src/Common/Base/ServiceOperation.cpp
===================================================================
--- sandbox/adsk/2.1/Server/src/Common/Base/ServiceOperation.cpp	2009-10-07 21:05:51 UTC (rev 4289)
+++ sandbox/adsk/2.1/Server/src/Common/Base/ServiceOperation.cpp	2009-10-07 21:10:32 UTC (rev 4290)
@@ -176,6 +176,10 @@
     Ptr<MgUserInformation> currUserInfo = dynamic_cast<MgUserInformation*>(m_stream->GetObject());
     assert(currUserInfo != NULL);
 
+    // Update the API version
+    currUserInfo->SetApiVersion(m_packet.m_OperationVersion);
+
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
     MgUserInformation::SetCurrentUserInfo(currUserInfo);
     m_packet.m_UserInfo = NULL;
 
@@ -185,7 +189,6 @@
     m_currConnection->SetUserName(currUserInfo->GetUserName());
     m_currConnection->SetSessionId(currUserInfo->GetMgSessionId());
     m_currConnection->SetCurrentOperationStatus(MgConnection::OpUnknown);
-    currUserInfo->SetApiVersion(m_packet.m_OperationVersion);
 
     // Decrement number of arguments since we have pulled the first one.
     m_packet.m_NumArguments--;

Modified: sandbox/adsk/2.1/Server/src/UnitTesting/TestKmlService.cpp
===================================================================
--- sandbox/adsk/2.1/Server/src/UnitTesting/TestKmlService.cpp	2009-10-07 21:05:51 UTC (rev 4289)
+++ sandbox/adsk/2.1/Server/src/UnitTesting/TestKmlService.cpp	2009-10-07 21:10:32 UTC (rev 4290)
@@ -48,12 +48,18 @@
     Ptr<MgUserInformation> userInfo = new MgUserInformation(
         L"Administrator", L"admin");
     userInfo->SetLocale(TEST_LOCALE);
+
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // This must be done before calling CreateSession()
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
     STRING session = svcSite->CreateSession();
     assert(!session.empty());
     userInfo->SetMgSessionId(session);
 
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    MgUserInformation::SetCurrentUserInfo(userInfo);
+
     m_siteConnection = new MgSiteConnection();
     m_siteConnection->Open(userInfo);
 }

Modified: sandbox/adsk/2.1/Server/src/UnitTesting/TestMappingService.cpp
===================================================================
--- sandbox/adsk/2.1/Server/src/UnitTesting/TestMappingService.cpp	2009-10-07 21:05:51 UTC (rev 4289)
+++ sandbox/adsk/2.1/Server/src/UnitTesting/TestMappingService.cpp	2009-10-07 21:10:32 UTC (rev 4290)
@@ -50,12 +50,18 @@
     Ptr<MgUserInformation> userInfo = new MgUserInformation(
         L"Administrator", L"admin");
     userInfo->SetLocale(TEST_LOCALE);
+
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // This must be done before calling CreateSession()
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
     STRING session = svcSite->CreateSession();
     assert(!session.empty());
     userInfo->SetMgSessionId(session);
 
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    MgUserInformation::SetCurrentUserInfo(userInfo);
+
     m_siteConnection = new MgSiteConnection();
     m_siteConnection->Open(userInfo);
 }

Modified: sandbox/adsk/2.1/Server/src/UnitTesting/TestRenderingService.cpp
===================================================================
--- sandbox/adsk/2.1/Server/src/UnitTesting/TestRenderingService.cpp	2009-10-07 21:05:51 UTC (rev 4289)
+++ sandbox/adsk/2.1/Server/src/UnitTesting/TestRenderingService.cpp	2009-10-07 21:10:32 UTC (rev 4290)
@@ -50,12 +50,18 @@
     Ptr<MgUserInformation> userInfo = new MgUserInformation(
         L"Administrator", L"admin");
     userInfo->SetLocale(TEST_LOCALE);
+
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // This must be done before calling CreateSession()
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
     STRING session = svcSite->CreateSession();
     assert(!session.empty());
     userInfo->SetMgSessionId(session);
 
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    MgUserInformation::SetCurrentUserInfo(userInfo);
+
     m_siteConnection = new MgSiteConnection();
     m_siteConnection->Open(userInfo);
 }

Modified: sandbox/adsk/2.1/Server/src/UnitTesting/TestTileService.cpp
===================================================================
--- sandbox/adsk/2.1/Server/src/UnitTesting/TestTileService.cpp	2009-10-07 21:05:51 UTC (rev 4289)
+++ sandbox/adsk/2.1/Server/src/UnitTesting/TestTileService.cpp	2009-10-07 21:10:32 UTC (rev 4290)
@@ -58,12 +58,18 @@
     Ptr<MgUserInformation> userInfo = new MgUserInformation(
         L"Administrator", L"admin");
     userInfo->SetLocale(TEST_LOCALE);
+
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // This must be done before calling CreateSession()
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
     STRING session = svcSite->CreateSession();
     assert(!session.empty());
     userInfo->SetMgSessionId(session);
 
+    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    MgUserInformation::SetCurrentUserInfo(userInfo);
+
     m_siteConnection = new MgSiteConnection();
     m_siteConnection->Open(userInfo);
 }



More information about the mapguide-commits mailing list