Data model changes that impact archiving

Sometimes changes that you make to the data model inadvertently affect archiving. In general, there are two categories of data model changes that can affect the archive domain graph. They are:

  • A new entity becomes part of the archive domain graph
  • An entity no longer exists as part of the archive domain graph

A new entity becomes part of the archive domain graph

Suppose, for example, that you add an additional entity type to the PolicyCenter archive domain graph. If the archive domain graph never referred to that entity previously, it does not appear in any XML representation of the archived entity instance. There is no issue.

However, suppose that an archived graph does refer to an entity type newly added to the graph:

  • The entity instance appears as a referenced entity in the XML.
  • On retrieve, the archive process looks for that entity in the database and links to it.
  • On re-archive of the entity instance, the archive process correctly exports the entity instance in the XML. There is no issue as long you do not delete the entity.

An entity no longer exists as part of the archive domain graph

It is possible for an entity to no longer exist as part of the graph. This can happen, for example, if the entity type was part of reference data that was shared by multiple policy periods, but is now removed from the archive domain graph.

Suppose, for example, that you remove an entity type from the PolicyCenter archive domain graph. If the archive domain graph never referred to that entity, it does not appear in any XML representation of the archived entity instance. There is no issue.

However, suppose that PolicyCenter archived the entity instance already, before you removed it from the graph. Then, at a later time, someone or PolicyCenter retrieves the instance. On retrieve, the archived instance causes a duplicate key violation as the archive process attempts to insert the already archived instance into the database. To handle this scenario, do the following:

  1. Search for the duplicate instance in the database.
  2. If found, call the gw.api.archiving.upgrade.IArchivedEntity method to create a new IArchivedEntity that is a referenced entity. The referenced entity must exist in the database.You can create a new referenced entity of any type.

See also