English

Bug: ArcSDE queries the states table on each versioned query when a version references state 0

Description

When working with versioned or non-versioned data sources in ArcSDE and ArcGIS, the geodatabase explicitly sets a state on each stream when accessing an objectclass in ArcSDE. The state property on the stream instructs ArcSDE to query the data source for that specific state.

If the version ArcGIS is accessing references state 0 and state 0 is set on the stream, ArcSDE queries the sde.states table to obtain the state's properties every time a stream is executed.

Cause

The ArcSDE gsrvr process was not initially designed to cache the properties of state zero.

Workaround

If the impact of these queries impede performance or scalability of the DBMS server, work-around the problem by moving the version to reference a state other than state 0.

Moving a version to reference a state other than state 0 can be accomplished one of two ways.

One method for updating a version is to add an objectclass that is registered as versioned to ArcMap, start editing, select one object and update an attribute to the same value, and stop editing (save). By changing and updating the attribute to the same value, a new state of the database is created and the data remains the same. Upon saving, the version is updated to reference the new state, which will always be a state greater than state 0.

A second approach for updating a version is by using the ArcSDE sdeversion command.

  1. Identify the state of the database the version currently references. This example uses the DEFAULT version as an example.

    Code:
    C:\> sdeversion -o describe -V DEFAULT -u sde -i esri_sde

    ArcSDE 9.2 for Oracle10g
    Administration Utility
    -----------------------------------------------------
    Instance default version.
    -----------------------------------------------------
    Version Name: SDE.DEFAULT
    Version ID: 1
    Parent Version Name:
    Parent Version ID: 0
    State ID: 0
    Access: Public
    Creation Time: 10/29/07 13:20:37

    If the version references a state other than state 0, then no further steps are required.
  2. Using the state id value from the sdeversion -o describe command's output, create a new state specifying the state id as the parent state.

    Code:
    C:\> sdeversion -o create_state -S 0 -u sde -i 5151

    ArcSDE 9.2 for Oracle10g
    Administration Utility
    -----------------------------------------------------
    Successfully created new state 151 as child of state 0:

    -----------------------------------------------------
    State ID: 151
    Owner: SDE
    Creation Time: 12/15/07 13:56:03
    Closing Time: Open
    Lineage: 0

  3. After the state has been created, close the new state. Use the state id from the sdeversion -o close command's output.

    Code:
    C:\>sdeversion -o close_state -S 151 -u sde -i 5151 -N

    ArcSDE 9.2 for Oracle10g Administration Utility
    -----------------------------------------------------
    Successfully closed state 151.

  4. The final step is to update the version to reference the new state using the sdeversion -o change_state command.

    Code:
    C:\>sdeversion -o change_state -V DEFAULT -S 151 -u sde -i 5151 -N

    ArcSDE 9.2 for Oracle10g
    Administration Utility
    -----------------------------------------------------
    Successfully changed version DEFAULT's state from 0 to 151.