Opened 12 years ago

Closed 12 years ago

#2151 closed task (fixed)

Address Local/LocalNative connection quirks

Reported by: jng Owned by: jng
Priority: low Milestone: Maestro-5.0
Component: Maestro Version:
Severity: trivial Keywords:
Cc: External ID:

Description (last modified by jng)

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.

Change History (2)

comment:1 by jng, 12 years ago

Description: modified (diff)

comment:2 by jng, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.