2

Reconciling versions makes both target and source(s) point to the same state. I have an arcpy script that essentially will create a version from a parent of the db - in a state that is empty - adds data to the feature classes, and then will append them to its parent's parent.

So its immediate parent is still pointing at a state that is empty. But now the child and the one it is merging with(state above its parent) are both point to a version that has a lot of data. Ideally, I would like a way to keep the child version just have the data that was loaded to it. Essentially have the child contain only data that came in during that process.

This seems like it should be a thing and would be a quick way to copy a lot of data to a version without the use of any cursors. I found this post When Versioning with ArcSDE can posted edits be cancelled or rejected? and it talks about editing the sde versions table. Hoping there is another option. However is there a clean way of changing the state using ArcPy? I am thinking, if I have to, I will just connect with pyodbc and then change the table.

Also, is it 100% that when a database version is created and then immediately reconciled without any other users or transactions happening, that its state will only one ahead of its creation?

  • 2
    This goal is incompatible with the way Versioning works. Hacking the state tree falls in the "Not supported in any way shape or form" category – Vince Apr 14 '15 at 19:09
1

The first three paragraphs of your scenario certainly fall under the unsupported category. It seems like you could add a step in your py script to create a child version of your child version immediately after your data load, and leave it there for your business needs.

To answer your final question, no. Version state ID incrementation is not always current version state ID + 1 during a reconcile even if reconcile occurs directly after version creation. In your scenario the factors that affect what state ID a version points to are the parent version state ID it is created as a child of, the nextval in the States sequence, and the INCREMENT_BY value set for the States sequence. This sequence is called STATE_ID_GENERATOR_NC and it should be left alone unless it was accidentally reset to a value below the highest value in your state tree.

The nextval in the sequence is important here, since your child could be created at state 1 from a parent version and after reconcile move to state 1,000,000 but remain in the same lineage.

The reconcile operation is one of a few versioning operations that can result in an incrementation of the state tree of more than one state, and there are a few core ways to run the reconcile operation.

  1. In an edit session in ArcMap, clicking the Reconcile button will create a state in the States table that is used for conflict detection. However, that state is never assigned to the version after just clicking Reconcile. You must then click the Post button to "finish the job" from ArcMap, and only after Post is completed will the version point to that state. Thus in this first example, without the Post operation a state is created but the version does not point to it.

  2. Calling the GP tool Reconcile Versions using either the BLOCKING_VERSIONS reconcile mode or the ALL_VERSIONS reconcile mode, the state ID of the reconciled version will increment by 2 states. The intermediate state that is created but unreferenced will still be in the States table and is later removed during a Compress operation. Note that those two reconcile modes may reconcile the versions in a different order, meaning the existence of other versions also affects where your recently created child version points to in addition to the sequence nextval.

  • Yes, to solve my problem I ended up just immediately creating a child version once data has been loaded into its parent. Reconcile that new child with a grand parent with the options post and delete. This ended up giving me the desired result. My grasp of versioning was not what it should have been when I went down that route. – branchini May 28 '15 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.