Hi all,
I have a dynamic map service that displays features from a file geodatabase in a client app. The location of the file geodatabase is registered with ArcGIS server so data is not copied to ArcGIS Server when the map service id published.
I also have a python script that runs every 2 minutes and updates an attribute field in the published feature class. The published fc has a definition query like [ColumnName] = 1. So the map should only display features whose value is 1.
The script updates the fc with 1 or 0 depending on whether the feature should be displayed or not. This was working before but for some reason the map service seems to be caching the state of this feature class at the time of publishing the map service.
Any changes that the script makes after publishing are not reflected in the map service. Any ideas on why this is happening?
Kind regards,
Solved! Go to Solution.
Hi,
Thanks Michael and Shan. I don't think there was anything wrong with the map service properties. I was not copying the data to ArcGIS Server when publishing either. I think something in the map service got corrupted somehow. Before I was overwriting my existing map service when publishing.
I decided to delete the map service entirely and recreate it and now it is working as expected.
Thanks for your suggestions,
Regards,
Wadson,
Can you check if the caching has been enabled in the map service? As per your description you have have the first option enabled on the map service.
I hope this helps!
~Shan
Thank you Shan,
The map service is set to dynamic retrieve the data i.e. top option as shown in your example above. The map service always keeps the state of the file geodatabase at the point of publishing and does not display the current status of the file geodatabase. I am convinced that is working but for some reason Arcgis server is not serving out the current status of the file geodatabase.
Kind regards,
Would it be possible to share screenshots of the service properties for this service?
Also, do you restart the service to push the updates made to the attribute table by the Python script?
~Shan
Hi Shan,
Do you want see all the properties or some specific ones?
I am not restarting the map service I thought map service should pick up the changes made in the file geodatabase through the definition query set on the feature class published. The location of the file geodatabase is registered with arcgis server and the data is not copied to server when published.
Kind regards
If it is not much trouble I'd like to see all the properties.
The reason why I asked if you were restarting the service was to confirm whether the restart displays the updated records or does it still show the old (cached) data.
Also, could you try and publish a new test service with the same data source and see if the issue replicates there as well? It is possible that the issue may be specific to this particular service and there might be some sort of corruption. I am merely speculating at this point, hence if you could help me out with a small test we can narrow down the issue.
~Shan
Did you have this setup working as expected in a previoue version of ArcGis Server?
Are you sure the data has not been copied to the server so every time you update the registered location that is not really where AGS us looking for the data so it never appears to be updafed?
Are you doing a truncate and append of the file gdb feature class every 2 minutes?
Hi,
Thanks Michael and Shan. I don't think there was anything wrong with the map service properties. I was not copying the data to ArcGIS Server when publishing either. I think something in the map service got corrupted somehow. Before I was overwriting my existing map service when publishing.
I decided to delete the map service entirely and recreate it and now it is working as expected.
Thanks for your suggestions,
Regards,
Did you have this mapservice and python working in a previous version of ArcGIS? If so, did you just migrate the mapservice to the new version and not re-create it?
Does your file gdb feature class keep getting larger with new records or do you just update the attributes of existing records with your scripts that run every 2 minutes?
I had the script and service working on the current version but it stopped working last week. My file geodatabase does not get any larger than it currently is. The script is just changing the attribute values with the same number of features. The problem was fixed by deleting the service and recreating it. Thanks.