Map Service with SQL table join not updating

3637
4
12-18-2014 05:37 AM
CurtWalker
New Contributor

I have a map service in which there is a polyline layer joined to an SQL table.  The table is pulled into ArcMap from a database connection.  ArcMap sees this table just like any other spatial table and the table join is successful.  The map publishes successfully.  In my Silverlight app I have defined a unique value renderer that's based on a field in the joined SQL table.  The renderer works and, at least at first, my polylines are correctly symbolized in the Silverlight app based upon the field in the joined SQL table.

The problem occurs when I update or insert rows in the joined SQL table.  For instance, an update might alter an existing row in the table that should then change the symbology of a polyline.  The table update is successful but the polyline doesn't change in the Silverlight app.  I checked that the update was reflected in the MXD and it is.  So I know the updates and inserts are happening successfully in the SQL table, and I can see the resulting symbology changes in the MXD, but those changes do not carry into the Silverlight app.

I tried several things, such as refreshing the service from within my Silverlight codebehind.  I also tried the Update method on the map service.  Neither worked.  The only thing that did work was to republish the entire service.  After republishing the next time I fired up the Silverlight app all the of the updates and inserts were reflected in the map's symbology.  This is obviously not a solution though.  I can't have my users waiting for a map service to republished between every single update they make, not that there is even a way to republish on the fly from within a Silverlight app anyway.

Is there a method I can call on the map service in Silverlight that would have the same affect as republishing but not take as long?

Thanks for your help.

0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor

You can try to set the FeatureLayer DisableClientCaching property to true. That will prevent from using the browser cache when updating the feature layer.

Not sure it's your issue but it's worth the try.

0 Kudos
CurtWalker
New Contributor

Thanks for the suggestion.  I applied that setting to my feature layer and it did not solve the problem.

When I click the button that fires the function that updates the joined table, it also fires the Update() method on the feature layer in question.  I can see that layer flicker in the Silverlight app, so I know it is being updated by the app, but apparently it is not receiving a truly updated version.  This makes me think there is some setting in ArcGIS Server itself that I need to change?  Or a cache that needs clearing every 1 second perhaps?

0 Kudos
CurtWalker
New Contributor

I just tried clearing the REST cache manually and it did not fix the problem.

0 Kudos
CarolKennedy
New Contributor

We are having the exact same issue using csv files.  The update shows up in the mxd but the only way I can get it to reflect in the webservice (flex in our case) is to totally republish the service and I do not see this as a reasonable work around.

0 Kudos