[mapguide-commits] r4649 - trunk/Tools/Maestro/MaestroAPI

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Mar 10 15:06:16 EST 2010


Author: ksgeograf
Date: 2010-03-10 15:06:16 -0500 (Wed, 10 Mar 2010)
New Revision: 4649

Modified:
   trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs
Log:
Maestro:
Fixed a severe performance issue with the LocalNativeConnection.
It was re-reading the server version on many occasions.

Modified: trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs	2010-03-10 20:00:15 UTC (rev 4648)
+++ trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs	2010-03-10 20:06:16 UTC (rev 4649)
@@ -31,6 +31,7 @@
 		private OSGeo.MapGuide.MgSiteConnection m_con;
 		private string m_locale;
 		private string m_sessionId;
+        private Version m_siteVersion = null;
 
 		private LocalNativeConnection()
 			: base()
@@ -395,6 +396,9 @@
 		{
 			get
 			{
+                if (m_siteVersion != null)
+                    return m_siteVersion;
+
                 try
                 {
                     MgSite site = m_con.GetSite();
@@ -406,14 +410,21 @@
 
                     for (int i = 0; i < col.Count; i++)
                         if (col[i].Name == "ServerVersion")
-                            return new Version(((MgStringProperty)col[i]).GetValue());
+                        {
+                            m_siteVersion = new Version(((MgStringProperty)col[i]).GetValue());
+                            break;
+                        }
                 }
                 catch
                 {
                 }
 
+
                 //Default
-                return SiteVersions.GetVersion(KnownSiteVersions.MapGuideOS1_2);
+                if (m_siteVersion == null)
+                    m_siteVersion = SiteVersions.GetVersion(KnownSiteVersions.MapGuideOS1_2);
+
+                return m_siteVersion;
             }
 		}
 



More information about the mapguide-commits mailing list