1

I have a mxd file that contains a few raster and feature layers that was published by ArcGIS Server as a map service. Meanwhile, a model was created to update the contents of the raster and feature layers in the mxd file. The intention is that all the users across my organisation will be able to see changes every time the model runs.

The problem that I have is the geoprocessing by the model failed due to the error that is the data "May be locked by another application." every time I ran it.

Could anyone please help with offering an idea how to get around this issue?

I also tried to use File Geodatabase to store the layers but ended up with the same error.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
alextc
  • 2,013
  • 2
  • 23
  • 44
  • Will it work if you Stop the map service, run the model, and then Start the map service again? – PolyGeo Mar 09 '12 at 02:07
  • 1
    What your seeing is a version/locking issue since the fGDB isn't able to really support that function. You need a enterprise GeoDatabase that you can version the data even just one level; so the mapservice is looking at the snap-shop while the data in the back-end is updated. – D.E.Wright Mar 09 '12 at 02:38
  • Yes, it did. When the service was stopped, the lock files associated with the feature layer were gone. The model ran perfectly. However, this process should run without any human intervention. – alextc Mar 09 '12 at 02:39
  • D.E.Wright - Are you talking about ArcSDE? Just wonder of any workaround without having to touch on the ArcSDE. Thanks! – alextc Mar 09 '12 at 02:42
  • Back to the question, do I need to create a geodatabase in ArcSDE and store the data there, and what else do I need to make the versioning config? Thanks – alextc Mar 09 '12 at 03:14
  • Problem solved. I still needed to store them in ArcSDE. No versioning and registration is required. Thanks for all your help! – alextc Apr 05 '12 at 04:57

1 Answers1

2

In What's New at ArcGIS 10.1 (which is linked to from resources.esri.com) it says:

"The new REST-based ArcGIS Server Administrator API allows you to administer your ArcGIS Server site through scripting. With this API you can automate tasks such as creating a site, adding machines, publishing services, querying the logs, and starting and stopping services."

This means you should be able to do what you want (without ArcSDE) when that version is released.

In the meantime starting and stopping maps services programmatically at 10.0 seems to be possible using a technique described in the ArcGIS Discussion Forum.

Or a better example of using AGSSOM courtesy of blah238 is found at StackExchange GIS.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • 1
    Perhaps a better example of using AGSSOM right here on GIS.se: http://gis.stackexchange.com/questions/17639/programmatically-start-and-stop-map-services-with-python/17777#17777 – blah238 Mar 09 '12 at 04:11