This class launches CDM model updates.
For each new schema version number there usually exists 1
ISchemaUpdater
which
represents a list of schema update steps.
schema updaters
are linked
to previous updaters which are called, if relevant, previous to the latest updater.
So it is possible to upgrade multiple schema version steps in one call.
As said before each
schema updater
creates a list of
update steps
.
ISchemaUpdater
support progression monitoring with each update step being one task.
ATTENTION: Some steps in the schema update are not transactional by nature. E.g. adding or removing a column
to a table in a SQL database can not be handled in a transaction. Therefore failures in
certain steps may not lead to a complete rollback of all steps covered by a
ISchemaUpdater
.
This may lead to a situation where the database becomes inconsistent.
HOW TO ADD A NEW UPDATER?
Adding a new updater currently still needs adjustment at multiple places.
1.) Increment
CdmMetaData
schema version number.
2.) Create a new class instance of
SchemaUpdaterBase
(e.g. by copying an old one).
3.) Update startSchemaVersion and endSchemaVersion in this new class, where startSchemaVersion
is the old schema version and endSchemaVersion is the new schema version.
4.) Implement
IUpdater.getPreviousUpdater()
and
IUpdater.getNextUpdater()
in a way that the former returns an instance of the previous schema updater and the later returns null (for now).
5.) Go to the previous schema updater class and adjust
IUpdater.getNextUpdater()
in a way that it returns an instance of the newly created updater.
6.) Adjust
getCurrentSchemaUpdater()
to return
instances of the newly created updater.
NOTE: Prior to cdmlib version 4.8/schema version 4.7 the CdmUpdater was split into a schema updater
and a term updater. This architecture caused problems and was therefore removed in 4.8.