How to disable schema locking on a map service without stopping the ArcGIS Server

5006
10
01-30-2018 04:30 AM
FatinRimawi
Occasional Contributor

Hi All,

Is there a way to disable schema locking on a map service without stopping the ArcGIS Server ?

When i published some layers, the locks files appeared in this path:

C:\arcgisserver\directories\arcgissystem\locks

I tried to delete them or find a way to delete them without  stopping the Arcgis Server, but i found nothing related to this issue.

I hope someone could help me on this.

Thank you in Advance

Fatin Rimawi

10 Replies
XanderBakker
Esri Esteemed Contributor

If this is an existing service, I'm pretty sure it will need to restart it to read any changes made to the schemaLockingEnabled setting. You posted this in the ArcGIS Server (10.0 and prior) group,  although it is a long time ago, I believe you were able to change this setting during the publishing of the service. Any particular reason why you can't restart the service, since it shouldn't create a lot of down time and if this is a production server, you should have considered upgrading to a newer version, since there is no support for AGS 10.0 and prior anymore.

FatinRimawi
Occasional Contributor

Hi Xander,

Thank you for your kind reply. Actually I'm using 10.5 and the issue still exists as i described it.

What do you think?

Best,

Fatin

XanderBakker
Esri Esteemed Contributor

When you publish a new service you can change the setting as explained in this post: Lock Database Schema - where to change default behavior? 

Change the setting to false and schema locking will be disabled for all the data in that service.

FatinRimawi
Occasional Contributor

Hi Xander,

 

Thank you for this clarification.

 

I am digging for this option, because we have a problem in overwrite publish the services as a following screenshot.

I know that we can do a workaround solution for this issue as following:

  1. Stop the arcgis server.
  2. Delete the locks files.
  3. Restart the arcgis server.
  4. Overwrite publish the service.

However, can we use this option “disable the schema lock" so we can get red or skip the locks and publish our services snugly?

Moreover, I read an article that recommended from this link, but my fears that the data itself may be affected If you update the dataset schema when the service is under load, users of your map service may experience unexpected behavior such as layers and fields missing, queries failing, and service unavailability."

 

To summarize my points:

  1. Does this option affect the database itself?
  2. Which layers that should use this option?
  3. Can we skip the locks files by using this option, to skip the lock files when publishing the services?

 

Thank you in Advance

Fatin Rimawi

XanderBakker
Esri Esteemed Contributor

Hi Fatin Rimawi 

The comment:

If you update the dataset schema when the service is under load, users of your map service may experience unexpected behavior such as layers and fields missing, queries failing, and service unavailability.

... is not too much related with the situation that you describe.The service will not change the data. It refers to when you have an existing service and you change the schema of the data the service depends on, this means for example adding or deleting fields, depending products like web maps, apps and perhaps the widgets used in it, will experience unexpected behavior when for instance a field it depends on is no longer present since it has been removed from the underlying data. 

I assume that if there are no transactions open, you should be able to update the service by overwriting it. Not sure what changes were applied to the service and underlying data and what dependencies exist on the service. Maybe inspect the logs to see if there is any additional information available.

If you have a workaround available why you do you not want to use it?

FatinRimawi
Occasional Contributor

Thank you Xander. I will to make  false schema locks option  and update you if i find or notice something new.

All the Best,

Fatin

MichaelVolz
Esteemed Contributor

If you are not changing the schema of the data and just updating the data itself, can you just use truncate and append processes on the data to bypass schema locks altogether?

FatinRimawi
Occasional Contributor

Hi,

I tried to keep the schema lock option as false, but i notice nothing, Xander.

I wish that someone can answer Michael's question, I have the same question

Best,

Fatin

DuarteCarreira
Occasional Contributor II

Hi there. Bit late, but I use the truncate/append method a lot and it works fine. I also reindex every index on the Feature Class (there's a tool for that too).

As long as this is a readonly mapservice this works fine with a small window of oportunity where a user may see an empty or incomplete dataset while the process is running.

But I feel this does not answer the original question: schema locking does not block editing. It blocks adding/removing fields and deleting the feature class.

Truncate+append allows to reload the entire feature class with data from scratch.

The added benefit is that any views that depend on the feature class are kept safe and keep working fine. As opposed to deleting and recreating a feature class will delete all views that use that feature class.