company logo

Database :: createMajorVersion - Create new major version

The function creates a new major version for the database. The new version is always appended to the end of the version list, i.e. the function always creates the "next" major version. The major version is created but not set as current access version. In order to change the access version to the new version, ObjectSpace::setMajorVersion() has to be called.

In order to get the currently update-able access version, the function selects the appropriate access version for the root object space and all its opened property handles (see ObjectSpace::setAccessVersion()). In case of subordinated object spaces, access versions for those object spaces remain unchanged.

The function can be called, when managed versioning feature is enabled. When no versioning mode is set (undefinedVersioning), managedDatabase versioning is enabled implicitly.

Creating the new major version will set the termination time point for the previous major version, which is the starting time point for the new major version. The end of the new major version is open, until the next major version will be created. Minor version is reset to 0.

New major versions can be created for databases enabled for workspaces only, when all workspaces are empty (consolidated or discarded).

When the database handle is not valid or when no new version could be created, the function throws an error.

Return value:  Major version number ( int32  )

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

Implementation overview

Implementation details

  1. Create new major version at given time point
    int32 Database  :: createMajorVersion ( odaba::DateTime &cDateTime )

    The function creates a new major version, which starts at time point passed in cDateTime. The timestamp indicates, when the last version is to be closed and when the new version will start. The time point passed in cDateTime must be a time point in future and greater than the last major version begin.

    • cDateTime - Time stamp

      A time stamp combines date and time

  2. to list
  3. Create new major version with current date and time
    int32 Database  :: createMajorVersion (  )

    The function creates a new major version, which begins immediately. After beginning the new version, all applications and servers accessing the database should stop and restart the application in order to open the database with the new major version. Older version instances cannot be updated anymore.

  4. to list