company logo

Versioning

The version concept describes the idea to maintain several instances for an object in order to reflect several states for the object. Usually (but not necessarily), a version is associated with a time point or interval, i.e. it reflects the state of an object at a certain time (interval).

Maintaining versions enables a system to represent previous (historical) states of an object.

A (data base) dimension defines the components necessary for identifying a data item within the database. Many database systems are two dimensional in the sense, that a data item is identified by an object instance identification (e.g. identity) and a property name. However, databases supporting different versions for object instances need one more component in order to identify the version of an object instance.

Version control in a most general way means that any object reflected in the data base is reflected including its history. There is no need (and no database) to have a continuous version update but successive time intervals might be defined in order to create version slices. Within a time interval (version slice) all modifications of the objects are treated as "corrections".

ODABA supports different types of versioning:

  • individual versioning (instance versions)
  • synchronized versioning (instance versions)
  • object versioning (object space versions)
  • consistent versioning (object space version)

Instance versioning and object space versioning cannot be mixed within one database, i.e. when object space versioning has been activated, instance versioning will be denied. Moreover, one cannot change the versioning mode after it has been set once.

Versioning modes

When creating a new database, the versioning mode is VersioningUndefined . Because the versioning mode is defined for a database all object spaces within a database do have the same versioning mode.

In order to set the versioning mode explicitly, one may call Database ::versioningMode() . After the versioning mode has been set once, it cannot be changed anymore.

When not yet being defined, the versioning mode is set automatically, when creating the first version slice or instance version. When calling ObjectSpace ::createDataVersion() for the root object space, the versioning mode is set to Consistent . When calling the function for a subordinated object space, Object_Space is set as versioning mode.

When calling Property ::createInstanceVersion() , instead, in order to create an instance version, versioning mode Individual is set for the database, when no versioning mode has been defined so far. Versioning mode Synchronized has to be set explicitly.