[Mapguide-trac] [mapguide-trac] #2151: Address Local/LocalNative connection quirks

MapGuide Open Source trac_mapguide at osgeo.org
Tue Oct 16 07:18:20 PDT 2012


#2151: Address Local/LocalNative connection quirks
-----------------------+----------------------------------------------------
   Reporter:  jng      |       Owner:  jng        
       Type:  task     |      Status:  new        
   Priority:  low      |   Milestone:  Maestro-5.0
  Component:  Maestro  |     Version:             
   Severity:  trivial  |    Keywords:             
External_id:           |  
-----------------------+----------------------------------------------------
Description changed by jng:

Old description:

> The Maestro.Local and Maestro.LocalNative connections by design will not
> actually respect the ini path parameter for subsequent connections made
> for that provider in the same application session.
>
> The reason for this is that both providers call MgdPlatform.Initialize
> and MapGuideApi.MgInitializeWebTier respectively, that load the necessary
> libraries (FDO) as indicated in the ini file. Subsequent calls to such
> methods return immediately, as the necessary libraries have already been
> loaded.
>
> Because there is currently no API in MapGuide or mg-desktop to actually
> tear down this initialized state (once set), creating subsequent
> connections for that provider may not (probably will not) respect the
> connection parameter values passed in.
>
> Basically connections to the Local or LocalNative providers are
> effectively singletons, and should be treated as such.
>
> For example. If you create a LocalNative connection using
> C:\foo\webconfig.ini and then create another LocalNative connection using
> C:\bar\webconfig.ini, the second connection will still be initialized
> with the settings from C:\foo\webconfig.ini, because the respective
> MgdPlatform.Initialize and MapGuideApi.MgInitializeWebTier methods that
> these providers call into are only meant to be called once.
>
> This has the following implications:
>
>  * You can't actually create multiple unique Local or LocalNative
> connections in the same application session. In the case of Maestro,
> after creating the first Local or LocalNative connection, you will
> actually have to restart Maestro in order to be able to create a
> connection with a different ini file.
>  * The MaestroAPI needs a way to programmatically check for this
>  * The Maestro Login dialog needs to guard against this. Basically once a
> Local/LocalNative connection has been created, do not show the connection
> UI. Instead the respective radio button should say "Connect to previous
> <Local|TCP/IP> session" or something to that effect.
>
> For the general use-cases (a normal desktop/web application), this would
> rarely be a problem as the application is unlikely to be creating
> multiple connections to different providers. But Maestro (with its multi-
> connection support) exposes this problem wide open and needs to be
> gracefully handled.

New description:

 The Maestro.Local and Maestro.LocalNative connections by design will not
 actually respect the ini path parameter for subsequent connections made
 for that provider in the same application session.

 The reason for this is that both providers call MgdPlatform.Initialize and
 MapGuideApi.MgInitializeWebTier respectively, that load the necessary
 libraries (FDO) as indicated in the ini file. Subsequent calls to such
 methods return immediately, as the necessary libraries have already been
 loaded.

 Because there is currently no API in MapGuide or mg-desktop to actually
 tear down this initialized state (once set), creating subsequent
 connections for that provider may not (probably will not) respect the
 connection parameter values passed in.

 Basically connections to the Local or LocalNative providers are
 effectively singletons, and should be treated as such.

 For example. If you create a LocalNative connection using
 C:\foo\webconfig.ini and then create another LocalNative connection using
 C:\bar\webconfig.ini, the second connection will still be initialized with
 the settings from C:\foo\webconfig.ini, because the respective
 MgdPlatform.Initialize and MapGuideApi.MgInitializeWebTier methods that
 these providers call into are only meant to be called once.

 This has the following implications:

  * You can't actually create multiple unique Local or LocalNative
 connections in the same application session. In the case of Maestro, after
 creating the first Local or LocalNative connection, you will actually have
 to restart Maestro in order to be able to create a connection with a
 different ini file.
  * The MaestroAPI needs a way to programmatically check for this
  * The Maestro Login dialog needs to guard against this. Basically once a
 Local/LocalNative connection has been created, do not show the connection
 UI again. Instead the respective radio button should say "Connect to
 previous <Local|TCP/IP> session" or something to that effect.

 For the general use-cases (a normal desktop/web application), this would
 rarely be a problem as the application is unlikely to be creating multiple
 connections to different providers. But Maestro (with its multi-connection
 support) exposes this problem wide open and needs to be gracefully
 handled.

--

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/2151#comment:1>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list