Issues Reconciling and Posting version using Python in ArcGIS Desktop 10

3546
3
10-23-2012 03:30 PM
SendhilKolandaivel
New Contributor
Hi,

We are running into an issue while reconciling and posting the updated version to the parent (DEFAULT) version, in a script that updates features in a feature class (W_HYDRANT), using Update Cursors.

The script uses two workspaces (.sde connection files) - one for editing the data using the Update Cursor, and the other for Reconciling and Posting the version.  These wokspaces are named inWorkspace and postWorkspace respectively.  The inWorkspace connection file uses the editor credentials, while the postWorkspace uses the Schema Owner credentials (DEFAULT version is protected).  Both versions point to a named version "MX_UPDATES", which is a child of default.

arcpy.ReconcileVersion_management(postWorkspace, editVersion, parentVersion,
                                  "BY_ATTRIBUTE", "FAVOR_EDIT_VERSION",
                                  "LOCK_AQUIRED", "ABORT_CONFLICTS", "NO_POST")


Here is the error message I get:

Traceback (most recent call last):
  File "P:\workareas\dus\repo\programs\python\maximo\Update_Hydrant_from_Maximo.py", line 201, in <module>
    "LOCK_AQUIRED", "ABORT_CONFLICTS", "NO_POST")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 9271, in ReconcileVersion
    raise e
ExecuteError: ERROR 000084: Conflicts detected, aborting the reconcile.
Failed to execute (ReconcileVersion).


I tried other variations with "NO_LOCK_AQUIRED" and "NO_ABORT", and am still unable to Reconcile.

Interestingly, I am able to manually reconcile and post this version without any issues - no conflicts.

I am able to see the updates in the 'A' table.

Key Points:

  • Using ArcGIS Desktop 10, SP5

  • Windows 7, 64-bit OS

  • ArcSDE (ArcGIS Server 9.3) running on Oracle 11g

  • Each Department have their own schema owned GDBS, ours is UTIL_SDE.

  • Default version is protected, so have to use the schema owner credentials to Post to it.

Any help or insights would be greatly appreciated!

Thanks,

Sendhil
0 Kudos
3 Replies
SendhilKolandaivel
New Contributor
Some follow-up info:

I used try-except around the reconcile, and it raises an exception.

Interestingly, it fails in the next line:

arcpy.DeleteVersion_management(inWorkspace, editVersion)

Here is error I get:

Traceback (most recent call last):
File "P:\workareas\dus\repo\programs\python\maximo\Update_Hydrant_from_Maximo.py", line 214, in <module>
arcpy.DeleteVersion_management(inWorkspace, editVersion)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 9210, in DeleteVersion
raise e
ExecuteError: ERROR 000386: Locked by database user: COH_UTIL_GISAPP_RW
Failed to execute (DeleteVersion).

I am not sure how the lock still remains. I had deleted the UpdateCursor Object and the row object after the updates. I wonder if this lock is causing the reconcile to fail as well.

Sendhil
0 Kudos
MathewCoyle
Frequent Contributor
It's hard to tell what is going on without the entire code you are running and the environment you are running in. If you are attempting to reconcile without posting your version is probably staying locked from deleting, but it should let the reconcile finish. Do you have the dataset open in an instance of ArcMap or Catalog?
0 Kudos
SendhilKolandaivel
New Contributor
Matthew,

Thanks for your response. I do not have any ArcMap or ArcCatalog sessions open that might lock the data.

I believe that the lock is due to updates done prior to the Reconcile in the script.

I am deleting the Cursor and Row objects after the data updates. I even added the following line to clear the workspace cache after the updates:

arcpy.ClearWorkspaceCache_management(inWorkspace)

Here are the result of GetMessages():

Start Time: Wed Oct 24 09:35:32 2012
ERROR 000084: Conflicts detected, aborting the reconcile.
Another application is currently editing the version. [COH_UTIL_GISAPP_RW.MX_UPDATES]
Failed to execute (ReconcileVersion).
Failed at Wed Oct 24 09:35:32 2012 (Elapsed Time: 0.00 seconds)

Thanks,

Sendhil
0 Kudos