Home    |    Concepts   |   API   |   Samples
Concepts > Versioning > Basic Principles
What is a state?

States are containers for changes to the database. As changes are made to a version, the changes are tagged with the appropriate state. A state has one owner, which is set to the user who creates the state. Only the owner of a state, or the ArcSDE administrator, can modify the properties of a state or delete it.

Versions exist on a network of database states. Each version of the database points to a specific state; multiple versions may point to the same state if desired. Over time, versions will move from one state to another. 

Database states are organized as a tree, where the parent/child relationship can be derived from the state lineage. 

A state may be OPEN or CLOSED. An open state allows the owner to add, delete or modify rows. You can not create new child states from an open state. Only the leaf nodes in the state tree can be open. Only the owner of a state, or the ArcSDE administrator, can open or close a state.

Only child states, or leaf nodes, of a database can be deleted, and only the owner or the ArcSDE administrator can perform the deletion.

Database states can be compared for row conflicts (deletions, additions, and modifications) between two states. A conflict is when the same row is different between the two states being compared or merged. States can be merged automatically where the changes in one state take priority when conflicts occur. Applications can manually resolve conflicts and allow changes to be selectively applied to the database.

You can trim the state tree, which collapses a linear branch of the tree. The child state will replace the parent state within the branch and discard all states which deviate from the direct path. Trimming database states reduces the depth of the state tree, shortening the lineage and improving query performance.

Trimming the state tree from state 7 to state 2, before and after.

You can also compress the state tree. Compressing the state tree removes each state that is not currently referenced by a version and not the parent of multiple child states. When executed by the ArcSDE administrator, all states that meet the compress criterion are removed regardless of owner. All other users can compress only the states that they own. This operation reduces the depth of the state tree, shortening the lineage and improving query performance.

The following example illustrates compressing the state tree:

Please also refer to the section on versioning in the Working with versioned data book of the ArcGIS Desktop or ArcGIS Server Help. (Can be accessed from the ArcGIS Resource Center.)

 

feedback | privacy | legal