<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.esri.com/Dev/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx</link><description>For the fastest performance of your ArcGIS Server map services, we recommend that you use map caching wherever it’s appropriate. A map cache is a picture of your map at one point in time. Map caches are obviously appropriate for maps that don’t change</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Debug Build: 61120.2)</generator><item><title>MapReduce for Large Geodatasets &amp;laquo; The Memory Leak</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#837</link><pubDate>Thu, 10 Jan 2008 22:45:06 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:837</guid><dc:creator>MapReduce for Large Geodatasets « The Memory Leak</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://ambergis.wordpress.com/2008/01/10/mapreduce-for-large-geodatasets/"&gt;http://ambergis.wordpress.com/2008/01/10/mapreduce-for-large-geodatasets/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#843</link><pubDate>Fri, 11 Jan 2008 17:30:18 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:843</guid><dc:creator>Greg Matthews</dc:creator><description>If you want to run more than one map cache update can you just duplicate the code in the same file? </description></item><item><title>re: Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#846</link><pubDate>Mon, 14 Jan 2008 16:54:55 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:846</guid><dc:creator>sterlingdq</dc:creator><description>&lt;p&gt;Greg- &amp;nbsp;Yes, you can run multiple updates in the script, in either sequential or looped form.&lt;/p&gt;
&lt;p&gt;Sterling&lt;/p&gt;
</description></item><item><title>re: Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#863</link><pubDate>Thu, 17 Jan 2008 21:40:17 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:863</guid><dc:creator>Chris</dc:creator><description>This script is not working for me, I've tried this on 2 servers and my desktop (AGS 9.2 SP3)  It reports:

C:\ARCGIS~1\scripts&gt;c:\python24\python.exe update.py
Starting Cache Update
Failed to generate cache. All server contexts failed to cache map.
Failed to execute (UpdateMapServerCache).

Failed to generate cache. All server contexts failed to cache map.
Failed to execute (UpdateMapServerCache).

Any thoughts?

# This script updates all tiles in an ArcGIS Server 9.2 map cache

# Access the geoprocessing tools
import arcgisscripting
gp = arcgisscripting.create()

# Set up all of the variables for the update tool
server_name = "L087XPx359"
object_name = "test"
data_frame = "Layers"
layers = "parcels"
constraining_extent = ""
scales = "32000000;16000000;8000000;4000000;2000000"
update_mode = "Recreate All Tiles"
thread_count = "2"
antialiasing = "NONE"

# Run the Update Map Server Cache tool
try:
    print 'Starting Cache Update'
    gp.UpdateMapServerCache(server_name, object_name, data_frame, layers, constraining_extent, scales, update_mode, thread_count, antialiasing)
    print 'Finished Cache Update'

# Get the error messages if the tool fails
except:
    gp.AddMessage(gp.GetMessages(2))
    print gp.GetMessages(2)
</description></item><item><title>re: Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#864</link><pubDate>Thu, 17 Jan 2008 22:42:07 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:864</guid><dc:creator>sterlingdq</dc:creator><description>&lt;p&gt;Chris- Some questions that might help troubleshoot:&lt;/p&gt;
&lt;p&gt;-Are there any relevant messages in the server log files after the tool fails? &lt;/p&gt;
&lt;p&gt;-Does the tool try to do something for a while then fail, or does it fail immediately? &lt;/p&gt;
&lt;p&gt;-Do any tiles get updated?&lt;/p&gt;
&lt;p&gt;-Can you successfully run UpdateMapServerCache from ArcToolbox with the same parameters?&lt;/p&gt;
&lt;p&gt;Sterling&lt;/p&gt;
</description></item><item><title>re: Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#867</link><pubDate>Fri, 18 Jan 2008 20:51:04 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:867</guid><dc:creator>Chris</dc:creator><description>Sterling, thanks for your help!

-Can you successfully run UpdateMapServerCache from ArcToolbox with the same parameters?
Yes.

-Are there any relevant messages in the server log files after the tool fails?

Not really.  In fact, I've compared the logs from my run with ArcCatalog with the script, both log outputs are the same, but the tools reports a failure and does not update any tiles.

One of the really strange things that I have found after setting logging to level 5 is that if I specify a map services that does not exists, it seems to default to the first one and tries to update the cache for it (but also fails).

-Does the tool try to do something for a while then fail, or does it fail immediately?
It takes about 20-30 seconds and then fails.
-Do any tiles get updated?
No.

Sterling
</description></item><item><title>re: Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#868</link><pubDate>Fri, 18 Jan 2008 21:16:17 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:868</guid><dc:creator>sterlingdq</dc:creator><description>&lt;p&gt;Chris- I took a closer look at your script and was wondering the following:&lt;/p&gt;
&lt;p&gt;- Does it work if you use layers = &amp;quot;&amp;quot; &amp;nbsp;Leaving empty quotes should cache all layers. By the way, is this a fused or a multilayer cache? &lt;/p&gt;
&lt;p&gt;- Are the scales in your script the same ones at which you originally built your cache? I ask because I noticed they are the same scales I used in the sample script. You should use your own scales.&lt;/p&gt;
&lt;p&gt;Sterling&lt;/p&gt;
</description></item><item><title>re: Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#871</link><pubDate>Sun, 20 Jan 2008 14:27:13 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:871</guid><dc:creator>Chris</dc:creator><description>Sterling,
&lt;br&gt;
Thanks for the hint on the scales, I've been using the ones that ArcCatalog uses when I update it via the GUI.  
&lt;br&gt; Good news!  I got the update to work, thanks much for your help.  However, the only combo that I could get to work is multilayer cache with out specifying the layers to update.  I can recreate all empty tiles or all tiles - no problem.  When I specify a layer name, it reports the same problem  &lt;br&gt; - Failed to generate cache. All server contexts failed to cache map.
Failed to execute (UpdateMapServerCache).
&lt;br&gt;
Not being able to create the fused cache is not really a big problem, but it would be nice to specify which layers should be updated in the multilayer cache.  
&lt;br&gt;
Do you think this is possible an issue with AGS 9.2 SP3 and I should try an upgrade or is there anything else you could suggest?
&lt;br&gt;
Thanks very much for your help,
Chris</description></item><item><title>re: Updating your map caches automatically:one or more contexts failed</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#913</link><pubDate>Sat, 02 Feb 2008 22:04:10 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:913</guid><dc:creator> Tom</dc:creator><description>The script worked successfully when tesing small areas using few polycons. But we got failed error "Updating envelope: 38 .......... Completed with error. One or more server contexts failed." during creating real data.

Any idea? Thank you for your halp. </description></item><item><title>re: Updating your map caches automatically: The key to caching dynamic data</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#948</link><pubDate>Sat, 09 Feb 2008 23:36:15 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:948</guid><dc:creator>Chris</dc:creator><description>OK, to get this working from an script, you will need to do a couple of things (or at least, this is what I had to do):
&lt;br&gt;
1)  Change the default "Maximum time a client will wait for a service to something much higher than the default (Tom, I think that might fix your problem)&lt;br&gt;
2)  With my configuration (Windows 2003/XP &amp; AGS 9.2 SP3) I had to supply an extent and that fixed my problem.  I think the take home lesson here is that if you are having problems with your python script and you can get it working interactively with ArcCatalog, experiment with the values that ArcCatalog defaults to and use that as your starting template.
&lt;br&gt;
-Chris</description></item><item><title>Starting and Restarting of MapService</title><link>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/01/04/Updating-map-caches-automatically_3A00_-The-key-to-caching-dynamic-data.aspx#4199</link><pubDate>Fri, 20 Mar 2009 17:52:20 GMT</pubDate><guid isPermaLink="false">b60b3f0a-e2bd-4be5-8a18-822c697649ab:4199</guid><dc:creator>Govindarajan</dc:creator><description>I had developed a program in Python that does the task of reading extents record by record and for every record it updates the cache. This is scheduled to run every night. But i found the starting of mapservices before and after the call to gp.UpdateMapCaching to be extremely annoying. With no direct support for updating the cache in 9.2,I fail to understand as how ESRI folks designed the api to force a restart everytime a call is made to the UpdateMapServerCache. Imagine if i have to update a cache for 100 different extents.

I hereby sincerely request ESRI to change the library so that the map service need not be started everytime.
</description></item></channel></rss>