SE_state_compress_tree

Compresses the instance’s state tree

Usage syntax

LONG SE_state_compress_tree (SE_CONNECTION connection);

Parameters
connection The connection handle
Description

This function compresses an instance’s state tree by removing all states that are not referenced by a version. Branches not referenced by a version are removed and nonbranching sequences between versions are trimmed.

Before compression, this state tree has two versions, S2 and S7.

After compression, only the two versions are left.

States S1, S3 and S5 were removed because they are not referenced by versions. States S4 and S6 are trimmed because they are are on unbranching sequences between versions.

Only the owner or the ArcSDE database administrator may trim states.

The ArcSDE compress method must be invoked in a session that does not perform edits. This is because when a session (ArcSDE Connection) is opened to edit a state(s), it places MARK locks on the state(s) which remain in place until the session (connection) is closed. If the compress function is invoked on the same session that edited states, the compress operation will not compress the states with locks on them. When compressing an ArcSDE database using the APIs it is always best to create a new session specifically for the purpose of compress.

Returns

SE_SUCCESS
SE_FAILURE

SE_DB_IO_ERROR

SE_INVALID_POINTER

SE_INVALID_STATE_ID

SE_NET_FAILURE

SE_NO_PERMISSIONS

SE_OUT_OF_SVMEM

SE_NOT_TABLE_OWNER

SE_SDE_NOT_STARTED

SE_STATE_INUSE

SE_STATE_TREE_INUSE

SE_TABLE_NOEXIST

SE_TOO_MANY_STATES