Error: ArcGIS: Unable to Save Edits- ArcSDE:Trim Error: State # referenced in state # lineage is not found in the states table
When editing an ArcSDE/Oracle versioned geodatabase in ArcGIS, the following error may occur:
"Unable to Save Edits"
While ArcSDE sde.errlog will contain the error message:
"Trim Error: State # referenced in state # lineage is not found in the states table"
The error can randomly occur based on the row ordering of the STATE_LINEAGES table where states are accidentally removed from the states table during the trim process.
The trim process can occur at three different times in the software:
1) While editing when the geodatabase undo/redo stack reaches a specific limit, the trim process is triggered to combine the first N number of edit operations.
2) Upon stop editing in ArcGIS. If multiple edit operations occur during the editing process, the trim process is triggered to combine all edit operations into one database state.
3) During compress, trim is performed to combine many states in a lineage into one state.
Solution or Workaround
Download the ArcSDE 8.1 for Oracle 8i/806 TRIM patch, by clicking on the link ESRI Patches and Service Packs, below. Click on ArcSDE > ArcSDE 8.1 for Oracle TRIM patch. Follow installation instructions.