Select to view content in your preferred language

Edits to SDE feature class not showing in jsapi site

1052
8
02-23-2012 05:48 AM
JustinAnderson
Emerging Contributor
Hello,

I have several SDE versioned feature classes that will be edited using different clients (ArcMap and a third party mobile application).  This data
is accessed throughout the organization using an AGS JSAPI site we have developed.  This site is built using dynamic map services and feature map services, but
no cached map services.  When our operational layers are edited, the changes (adds, deletes) don't appear on our AGS JSAPI site upon its intial load.  So, for example,
when the site intially renders a map, a feature that has been deleted outside the application is still visible.  However, on any extent change (zoom in/out, pan, etc) the
edited data is rendered correctly (deleted features no longer visible).  Refreshing the site in internet explorer, even many hours after the edits were written to the database has no effect (for the intial extent).  I've tried restarting the map services with no luck.  In addition, I've looked at the map service through the generic JSAPI viewer in the AGS services rest folder, with the same issue (initial extent problemtic, all other extents fine). 

If anybody has run into a similar issue and can shed some light I would be very grateful.

Thanks,
Justin
0 Kudos
8 Replies
derekswingley1
Deactivated User
Are all apps referencing the same geodatabase version?
0 Kudos
JustinAnderson
Emerging Contributor
All applications are working with the same geodatabase version.
0 Kudos
derekswingley1
Deactivated User
In IE, does reloading with shift + f5 cause the feature to display?
0 Kudos
JustinAnderson
Emerging Contributor
Derek - Thanks for the suggestion. Unfortunately shift - f5 has no effect.
0 Kudos
JeffPace
MVP Alum
IE is terrible isn't it?

It sounds like, since the initial load is always an identical request, IE is seeing this and caching the return map.  When you navigate a new request is created and that is why it updates.

You can try a couple things to get around this.

1. Randomize you initial extent a few millimeters.  User will never notice, but the requests will be unique (terrible but functional)
2. Check you reverse-proxy/web cache/firewall and set the particular service not to cache.
3. Even worse, if all else fails, you could add an dojo.isIE (do some tiny navigate)

sorry I can't think of better solutions.  In fiddler, you should see if the initial map request is drawing new or displaying a cached result.  This would confirm the behavior at least.
0 Kudos
JustinAnderson
Emerging Contributor
ESRI Support offered some good suggestions that fixed my issue.  I just needed to add

.setDisableClientCaching(true);
and
.refresh();

to my dynamic map service and everthing works great.

Thanks,
Justin
0 Kudos
AdrianMarsden
Honored Contributor
So, is refresh() an undocumented method of ArcGISDynamicMapServiceLayer?  it certainly seems to do what it says?
0 Kudos
AndyBurns
Regular Contributor
We have been using refresh since 2.8, i have to be honest though and say i have no idea (or cannot remember) how i stumbled across it.

 function refreshTimer()
  {
   setInterval(function(){
    dojo.forEach(electionLayers, function(layer){
     layer.refresh()
    });
   }, 30000);
  }


We have a call to refresh the dymanic service looking at SDE data, seems to work fine so far in all browsers.
0 Kudos