Freezing an Object Version

Meta Data Services Programming

Meta Data Services Programming

Freezing an Object Version

In the version graph, each object version with an emerging (solid or dashed) arrow must be frozen. The other object versions can be frozen or unfrozen. One purpose of the repository engine's versioning capability is to let you maintain multiple versions of an object so that you can remember what the object was like at different times. After you decide that a particular version of an object is worth remembering, you must protect that version of the object from further modification. You do this by freezing the object version. To freeze the object version, invoke the FreezeVersion method with an IRepositoryObjectVersion interface pointer to the version you want to preserve.

When you freeze a version of an object, you prevent any program from modifying any of its origin collections or any of its nonannotational property values. A program can, however, modify a frozen object version in the following ways:

  • Modify a frozen object version's destination collections. By allowing such modifications, the repository engine lets you protect an object (such as a text formatting template) from further modification, yet allows other, newly created objects (such as text files) to include the frozen object version in their origin collections.

  • Modify an object's annotational properties. If a class exposes (through one of its interfaces) an annotational property, the repository engine stores one value of that property for each object (not one property value for each object version). Thus, if you change an annotational property value on an unfrozen version of an object, the change affects all versions of that object, including the frozen versions.

The repository engine provides two methods for you to manage the frozen status of an object version:

  • FreezeVersion freezes a version of an object.

  • IsFrozen (exposed by IRepositoryObjectVersion) determines whether an object version is frozen or unfrozen.

See Also

Branches in the Version Graph

Creating Object Versions

IRepositoryObjectVersion Interface

Merging Object Versions

Version Graph

Versioning Objects