Select to view content in your preferred language

Account to Post and Reconcile a child SDE Version

1697
4
06-13-2017 12:47 PM
JoseSanchez
Frequent Contributor

Hello everyone,

Question: when posting  and reconciling a child version using Python, can I use another account different from the owner of the child version, to post and reconcile?

I tried to use the schema owner account and do two tests:

 -  first test digitized a new feature in child version, ran Python script to post and reconcile, and the new feature showed in the parent  version,

 -  the second test, deleting feature in child version, ran Python script below to post and reconcile, but this time it did not work, the feature was not deleted from the parent version (Default)

Any suggestions?

   

Python script post/reconcile part.

if version == MyChildEditingVersion:

# Execute Post and Reconcile

print "Execute Post and Reconcile in " + MyChildEditingVersion

arcpy.ReconcileVersions_management(sdeGeodatabase,

"ALL_VERSIONS",

ParentVersion,    ============= Default

MyChildEditingVersion,

"LOCK_ACQUIRED",

"NO_ABORT",

"BY_OBJECT",

"FAVOR_TARGET_VERSION",

"POST",

"KEEP_VERSION",

reconcileLog)

4 Replies
Asrujit_SenGupta
MVP Regular Contributor

Some things to keep in mind while trying these:

1. What are the access levels of the Versions?

2. Which login are you using to connect and perform the reconcile\post

3. In case of a Conflict, what options have you mentioned in the Script (your script is supposed to resolve conflicts in Favour of the Parent version, which is Default).

If you are connecting using any Admin login(example: any sysadmin login in SQL Server) to connect and perform the Reconcile\Post, then it should work for all scenarios.

0 Kudos
JoseSanchez
Frequent Contributor

Hi Asrujit ,

We are working on SDE 10.2 with Oracle 11G


This is the scenario that works:
 - Create a version in SDE using ArcCatalog with user ID:  JoeGIS. The version JoeGISVersion child of Default.

 - Using ArcMap, drag and drop layers using connection with account JoeGIS and editing JoeGISVersion. 

 - Digitize a new feature, Post and Reconcile. Change current version to Default and the new feature is there

 - Change current version to   JoeGISVersion, remove the feature created, post and reconcile. Check in Default and the feature was deleted from Default.

This scenario does not work:

in SDE layers are owned by  schema owner or administrator account, lets call this account "Company" .

- Using ArcMap, drag and drop layers using connection with account JoeGIS and editing JoeGISVersion.

- Digitize a new feature 

- with python script using  schema owner account -"Company"- post and reconcile

- check SDE Default and the new feature shows in Default

- Using ArcMap  with account JoeGIS and editing JoeGISVersion, delete feature created

- with python script using  schema owner account -"Company"- post and reconcile

- Check in Default, the feature was not deleted.

Questions:

1. What are the access levels of the Versions?

I do not understand this question. If you mean version levels, it is a parent child

2. Which login are you using to connect and perform the reconcile\post

 - test that works, usiuser account  JoeGIS

 - test that does not work, schema owner

3. In case of a Conflict, what options have you mentioned in the Script (your script is supposed to resolve conflicts in Favour of the Parent version, which is Default).

 "FAVOR_TARGET_VERSION",

Thanks

0 Kudos
Asrujit_SenGupta
MVP Regular Contributor

Creating versions and setting permissions—ArcGIS Help | ArcGIS Desktop 

You set the access level of a version to protect it from being edited or viewed by users other than the version owner. You can set one of three permissions on a version:

  • Private: Only the owner or the geodatabase administrator may view the version and modify versioned data or the version itself.
  • Protected: Any user may view the version, but only the owner or the geodatabase administrator may edit datasets in the version or the version itself.
  • Public: Any user may view the version. Any user who has been granted read/write (update, insert, and delete) permissions on datasets can modify datasets in the version.

When setting access on versions, consider your version workflow strategy along with the needs of the various users working within that framework. You should use version access along with dataset permissions to control access to the data.

From your description, it seems all your Versions have the PUBLIC access level.

A quick tour of reconciling a version—ArcGIS Help | ArcGIS Desktop 

Prerequisites

To be able to reconcile, the following must be true:

  • You must be the only user currently editing the version you are reconciling.
  • No other user can be editing the target version. The exception is if the target version is DEFAULT—you can reconcile against DEFAULT even when other users are editing it.
  • You must be able to view the target version, meaning it can be public or protected. If it is private, you must be the owner or the ArcSDE administrator.
  • If your workflow is such that one user edits and another user reconciles, make sure the user who reconciles has full permissions to all the feature classes and tables that have been modified in the version; otherwise, he or she will not be able to reconcile. The user reconciling must have full permissions to both sides of any relationship that has been modified, including simple or composite relationships. In this type of workflow, the user reconciling must also have sufficient version permissions. The reconciling user must be able to modify the version to reconcile, meaning it must be public, and must be able to view the target version, meaning he or she either must own the version or it must be public or protected.

These are the Prerequisites. So as long as you are meeting them, any user can be used to perform the Reconcile\Post.

3. In case of a Conflict, what options have you mentioned in the Script (your script is supposed to resolve conflicts in favor of the Parent version, which is Default).

 "FAVOR_TARGET_VERSION",

By this I was intending to say that, whenever there is a Conflict, it will resolve in favor of the Target version (which is Default in your case). So the conflicting edits in the Edit\Child Version will be lost.

For your experimentation, do not delete the same feature that you just created. Instead delete another feature which was already present and then check the behavior.

JoseSanchez
Frequent Contributor

I am just running the job with the account that created the child version and the post and reconcile works fine.

Thank you

0 Kudos