Select to view content in your preferred language

How does the "ReconcileVersion" GP tool handle itself when it finds conflicts?

612
3
09-22-2010 08:16 AM
DanNarsavage
Frequent Contributor
All,

     I'm creating a python script that creates a version in SDE, makes a bunch of edits in that version, and reconciles.  If no conflicts are found then I want it to post to default, delete the version, and leave me alone.  If it finds conflicts then I want it to skip the post, not delete the version, and yell at me.

     Using this doc, I wrote this line:

arcpy.ReconcileVersion_management(SdeGDB, VersionName, "sde.DEFAULT", "BY_OBJECT", "FAVOR_TARGET_VERSION", "NO_LOCK_ACQUIRED", "ABORT_CONFLICTS", "POST")


     But the doc referenced above doesn't specify what exactly happens in an "abort" when conflicts are found.  Is an exception thrown?  Or does the geoprocessor simply avoid posting and silently move on?  I'll likely run my script on a test dataset and have an answer for myself, but I think this needs some clarification in the doc . . .

Thanks,
Dan
0 Kudos
3 Replies
DanNarsavage
Frequent Contributor
Good news.  This code:
try:
        arcpy.ReconcileVersion_management(SdeGDB, VersionName, "sde.DEFAULT", "BY_ATTRIBUTE", "FAVOR_TARGET_VERSION", "#", "ABORT_CONFLICTS", "POST")
except Exception, inst:
        print "RECONCILE FAILED:\n", inst
else:
        CleanUpVersion()


Yields this output:
Reconcile failed:
ERROR 000084: Conflicts detected, aborting the reconcile.
ERROR 000533: The version cannot be posted to the reconcile version. Reconcile must be performed before the post operation has been done.
Failed to execute (ReconcileVersion).


So an exception is in fact raised.  Yay for me!  The only bad news is that the tool wouldn't accept either documented value for the "acquire_locks" parameter.  I skipped the parameter altogether and that suited my purpose just fine.
0 Kudos
dmacq
by
Occasional Contributor
Digging this one up for anybody else that's run into this.

Dan, your issue with the "acquire_locks" parameter is that you spelled "Acquired" correctly.  The tool expects "AQUIRED" despite what the documentation says.
0 Kudos
DanNarsavage
Frequent Contributor
Ha! Thanks Drew.  Nice catch!
0 Kudos