company logo

Database :: resetMajorVersion - Reset major version

The function may be called in order to reset the database version when managed versioning feature is enabled. The function will reset all major versions greater than or equal to the major version number passed in iVersion, i.e. changes made in higher versions will be reset. The function removes all database entries with the newer version numbers, i.e. version numbers greater or equal to iVersion, and recreates the state of the database entry for the previous major version number (iVersion-1). The database has to opened exclusively. One cannot reset version 0, i.e. The version number passed in iVersion has to be greater than 0.

Resetting major versions will also reset all database entry minor versions created within a major version and restores last database entry minor version with the previous major version (iVersion-1). In case of managed object spaces, object space versions are reset to the new major version (iVersion-1) and the maximum minor version found when resetting instances.

After resetting a major version one should close and reopen the database.

When an invalid version number has been passed in iVersion or when the versioning mode is not managed, the function throws an exception.

Notes:

Resetting object space versions might be improved by creating object versions for object space descriptor entries in the database

Implementation details

Database  :: resetMajorVersion ( int32 iVersion )
  • iVersion - Major version number

    Major versions are defined on database level. database versions are numbered consecutively beginning with 0, when consistent versioning has been enabled.