a week ago
When using GeoMedia WebMap we may choose to work with several MapServers. Each MapServer caches the connection to the warehouse. If we now digitize and one MapServer it writes this information to the warehouse. Then the map gets refreshed but the new content on the map only displays if the same MapServer has been chosen by the MapServerManager. If another MapServer is chosen randomly then the changes, which have been made to the warehouse are not visible on the map.
For our local product, we use a workaround for years. We force the program to close and reopen the connection to the warehouse to be able to display the new content. With better machines our customers started to use more MapServers at the same time, what slows down the performance. Therefore the question:
Is it possible to update the content of the warehouse with broadcast database changes so we don't need to close and re-open the connection to the warehouse every time?
I'm unaware of any such capabilities in the core Connection object.
What you could do, however, is to reopen only the GRecordset that you are using, instead of the whole Connection object. This might be more performant, as there will be no reloading of GDO metadata.
var notification = (Notification)recordset.GetExtension("Notification
This will work only for OriginatingPipe based GRecordsets, though.
Actually, this is what WebMap does in its standard workflows, and that's why there is no issue with obtaining WFS features modified through a transaction request from a different MapSvr.exe process.
This is sadly not working. Probably because the WFS uses the export services which use directly the recordsets. We use the CreateMapByRange() method that most likely uses a different caching mechanism with the legend entries.
There's also a ReloadDatabase() Method on the connection object that also does not have any effect when using the CreateMapByRange() method.
So far only the hard way, disconnecting and reconnecting the connection, leads to the correct result.
MapSvr::CreateMapByRange operates on the Legend object which is built from LegendEntry objects each of which references a Recordset. This method also applies spatial filtering, which actually does the Notification::Reopen. AFAIK, Connection::ReloadDatabase results in closing and reopening all the OriginatingPipe objects, which is in fact what Notification::Reopen does.
Now I'm stumped. I wonder if that's because you use a specific warehouse connection type. Can you provide more details on your setup and implementation?
|Ausflugsrouten||Access.GDatabase||D:\BM Data\BM Geodaten\Access\Schweiz\Digitalisieren\Ausflugsrou||Read/Write||Open|
WebMap is Version 16.00.0200.00004 Professional, with 2 MapSvr.exe running. However, this problem exists since I know WebMap, from 6.1.
We draw something in the map and press save -> ajax to server -> get a free mapserver -> connect to the db if not cached -> get the grecordset -> call addNew and then update -> status code 200 with connection name
As soon as this succeeded -> new ajax to server to request the new map, connection name is passed -> get a free mapserver -> use the connection name to disconnect/reconnect the cached connection -> connect to lib -> call getFromLibrary -> append legendEntries to mapserver -> call CreateMapByRange
So, the part use the connection name to disconnect/reconnect the cached connection looks like this:
Public Function refreshMapServerConnections(strConnectionName) Dim objConn For Each objConn In m_objMapServer.Connections If UCASE(objConn.Name) = UCASE(strConnectionName) Then m_objMapServer.WriteLog 5, "BM: reload database connection " & strConnectionName Dim connection: set connection = m_objMapServer.Connections(strConnectionName) 'connection.Disconnect() 'connection.Connect() 'connection.ReloadDatabase() Dim origPipes: set origPipes = connection.GetOriginatingPipes() Dim origPipe For Each origPipe In origPipes Dim notification: set notification = origPipe.OutputRecordset.GetExtension("Notificatio
n") notification.Reopen() m_objMapServer.WriteLog 5, "BM: reopen notification " & origPipe.table Next m_objMapServer.WriteLog 5, "BM: reload database connection done" End If Next End Function
Only the disconnect() connect() variant guarantees me, that the new geometry object is contained in the png or svg map on every mapserver.