Select to view content in your preferred language

Feature classes locked by ArcGIS server services

6773
14
04-21-2010 09:45 AM
JacksonTrappett
Frequent Contributor
I have several models that we use to update our datasets on a weekly or monthly basis due to changes in parcels and new annexations, etc.  The final output of these models overwrites production feature classes in our SDE geodatabase.  These same feature classes are used by our ArcGIS Server services for our web maps.  Of course every time we run the models I first have to stop the services so that the SDE datasets are not locked while they run/overwrite.

What I'm looking for is one of two things:
A. A way in model builder to stop and then restart the services only during the part of the model that is overwriting the feature class.  Can services be stopped and started in Model builder?  I haven't seen a way yet.  This option would allow me to run our large models (some of them take 30 to 45 minutes to run) without having to have the services stopped for the entire time, which I don???t like to do because it makes them unavailable to customers for the duration.

B. A better publishing model for ArcGIS Server that doesn't lock the datasets.  The only one I've been able to come up with so far would be to have two copies of the same SDE database.  One of them would be the one we update with our models and edit, and the other would be the one the ArcGIS server services are hooked into.  The two would be linked by one way replication, which can synchronize the changes without having to stop the services.  This seems like the best option to me but it requires quite a bit of work to create and maintain another SDE geodatabase.

Anyone have ideas for me on either A or B or both?  If A is possible I will probably just go with it since it is much easier to set up and maintain.
0 Kudos
14 Replies
BartPouteau
Deactivated User
Randy,

I may be misunderstanding your reply, but the data in questions wasn't versioned to accommodate this process.  It was versioned for other business process reasons.

Bart
0 Kudos
JaredAndre
Emerging Contributor
My recommendation would be to work within the versioning framework, programmatically creating a child version to add/delete/modify your features, especially if versioning is already a business process requirement.  You can then even run an automated reconcile/post process to push the updated records up to the ArcGIS server 'display' version, or alternatively run the updated features through your normal QA/QC processes.  It's a little more overhead than simply overwriting feature classes in their entirety, but works pretty well and fits nicely within the standard versioning/business process without impacting other ArcGIS data operations.
0 Kudos
MeleKoneya
Frequent Contributor
I created the following to append features

       public static void AppendFeatures(string inFC, string outFC)
        {
            ESRI.ArcGIS.Geoprocessor.Geoprocessor GP = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
            Append AppendFeatures = new Append();
            AppendFeatures.schema_type = "NO_TEST";
            AppendFeatures.inputs = inFC;
            AppendFeatures.target = outFC;
            RunTool(GP, AppendFeatures, null);
        }

RunTool is calling a method with code that Chad Cooper wrote and is available at http://www.esri.com/news/arcuser/0410/gpandnet.html

The code above works great on everything but Annotation,    any suggestions on how to append to Annotation?    Threre is AppendAnnotationFeatureClasses Tool, but it creates a new feature class from inputs rather than appending to an existing feature class.

Thanks,

Mele
0 Kudos
TamaraRosenzweig
Emerging Contributor
Like others in this thread,    we have been having some issues updating our SDE feature classes when they are used by ArcGIS Server Map Service.   I just tried adding the schemalockenabled tag set to false on a map service on ArcGIS Server 9.3.1 SP1 and was not able to update the feature class as it returned a lock on the feature class.      We have been using the 'sledge hammer' approach of stopping all ArcGIS Map Services while loading data, but it would be nice to not have to stop these services.

I am wrong in believing that this functionality was added in SP1?

We also break connections to our ArcSDE databases using SDEMON -o kill, but this does not work against the ArcGIS Map Services so we have to stop them.

I am curious as to how others are dealing with these locking issues so let me know if anyone in this thread has made some progress in dealing with this.

Thanks,

Mele



Did you restart the SOM on the server after you updated the cfg files?  If you don't, it won't recognise the addition of the schemalockingenabled tag.

Tamara
0 Kudos
chapcole
New Contributor
we have faced a similar issue at my office, depending on the process and the what the intentions of your results are I would recommend establishing the workspace and the scratch workspace of the model to be on a local drive. This allows you to work seperate from SDE and can prevent from having model intermediates or outputs from locking down services. I actually recommend creating variables and setting them as parameters so that for each time you use the model you can establish a new work space. It may create some redundancy issues but as long as you are aware of it I see no real problem. If you are not familiar with enviroments and workspaces it might be good to check out esri's advanced model builder book.
0 Kudos