Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
stylenone

Failures and Possible Solutions

Normal Entities

...

Conflicts

Type

Description

Solutions

Challenges

Solutions(NO)

AMID

  • An object with this AMID already exists

Genarate

  • Replace all objectReference

Erstatt alle objektreferanser
  • GENERATE

  • FAIL

PK

  • An object with this primary key already exists

  • Single PK only for now

Genarate if UUID

  • Replace all FK

  • How to handle composite PK?

  • Should we generate other types? If so then how?

  • Erstatt alle fremmednøkler

Input from the user

  • Requires user interaction

  • GENERATE

  • SET_BY_USER

  • FAIL

UNIQUE

  • An object with this value for this field already exists

Genarate if UUID

  • Should we generate other types? If so then how?

Input from the user

  • Requires user interaction

Set null if nullable

  • GENERATE

  • SET_BY_USER

  • SET_NULL

  • FAIL

FVP_UNIQUE

  • Applicable for fields with field value pattern

  • An object with this value for this field already exists

  • Root entities only for now

Genarate

Input from the user

  • Requires user interaction

Set null if nullable
  • GENERATE

  • SET_BY_USER

  • SET_NULL

  • FAIL

FK

  • The parent object referred by this field not found

  • Not yet supported

Set null if nullable

Input from the user

Requires user interaction
  • SET_NULL

  • FAIL

REQUIRED

  • No value present for this required field

Genarate

  • Generate dummy values if not UUID or FVP

Input from the user

  • Requires user interaction

Set null if nullable

LENGTH
  • GENERATE

  • SET_BY_USER

  • FAIL

TYPE

  • Value type not compatible with the field type

Genarate

  • Generate dummy values if not UUID or FVP

  • GENERATE

  • SET_BY_USER

  • SET_NULL

  • FAIL

LENGTH

  • Applicable for varchar fields with a length set

  • Text length is longer than the limit

Trim extra

Input from the user

  • Requires user interaction

Set null if nullable

System Entities

For this section, we need to consider the system root entities like AKTOR, TAG, etc. and ignore AMID/PK conflicts for all sub-entities. We have added options for handling AMID/PK/Unique/FVP Unique conflicts for the system root entities.

Conflict

Solutions

Challenges

  • AMID

  • PK

  • UNIQUE

  • FVP_UNIQUE

Ignore
  • TRIM_EXTRA

  • SET_BY_USER

  • SET_NULL

  • FAIL

Root System Entity

  • AMID

  • PK

  • UNIQUE

  • FVP_UNIQUE

  • Applicable for root system entities (AKTOR, TAG, RESTRICTION)

  • IGNORE

  • REPLACE_WITH_CONFLICTED

Solutions

Type

Description

Challenges

GENERATE

  • Generates a new value based on the field type or using the field value pattern

  • Not available for PK and UNIQUE if field type is not UUID

  • For AMID, replace all objectReference

  • For PK, replace all FK

  • How to handle composite PK?

  • Should we generate PK for other types? If so then how?

SET_BY_USER

  • Input from the user

  • Not applicable for conflicts that are gathered during import

  • Requires user interaction

SET_NULL

  • Applicable for nullable or not required fields

SET_NULL_OR_REGENERATE

  • Set null if nullable or generate a value (dummy) based on the field type

  • Applicable for conflicts that are gathered during import

TRIM_EXTRA

  • Trim the extra part

  • Applicable for varchar fields with a length set

IGNORE

  • Ignore this object and it’s descendants

  • Applicable only for root system entities

  • Highest precedence

  • Ignore the whole subtree for this

row
  • object as well

  • Highest precedence

  • Replace with the conflicted row

    Replace all objectReference and FK

    REPLACE_WITH_CONFLICTED

    • Ignore this object and it’s descendants but keep the relation objects (AKTOR_RELASJON, TAG_MAPPING, OBJECT_RESTRICTION)

    • Import relation objects but change the relation to connect to the conflicted row

    • 2nd highest precedence

    • Ignore the whole subtree for this object as well

    • Keep the relation objects but change their FK

    2nd highest precedence
    • Should we consider the possible new sub-entity objects?

    • Should we consider the possible changes for this subtree?

    Replace with a chosen row (Maybe later)

    FAIL

    • Throw an error and abort

    • Applicable for conflicts that are gathered during import

    Implementation

    We can divide the implementation into four key steps.

    ...

    After clicking the Resolve button a new tab will be opened. In the tab, there will be options to choose how do you want to proceed. There will be options present per conflict type. Either you can gather the conflicts beforehand, or gather and solve them while importing, and the third option is to mix both, meaning gather some types beforehand but resolve the rest while importing.

    ...

    Conflict Type

    ...

    Default Solutions (Used while importing)

    ...

    Description

    ...

    AMID

    ...

    Generate

    ...

    • Generate a new UUID

    ...

    Fail

    ...

    • Throw error and abort

    ...

    PK

    ...

    Generate

    ...

    • Generate a new UUID

    • Available if all are UUID

    ...

    Fail

    ...

    • Throw error and abort

    ...

    UNIQUE

    ...

    Generate

    ...

    • Generate a new UUID

    • Available if all are UUID

    ...

    Fail

    ...

    • Throw error and abort

    ...

    FVP_UNIQUE

    ...

    Generate

    ...

    • Generate a new FVP

    ...

    Fail

    ...

    • Throw error and abort

    ...

    FK (Not supported yet)

    ...

    Set Null

    ...

    • Set null if nullable

    ...

    Fail

    ...

    • Throw error and abort

    ...

    REQUIRED

    ...

    Generate

    ...

    • Generate a dummy value

    ...

    Fail

    ...

    • Throw error and abort

    ...

    TYPE

    ...

    Set Null or Generate

    ...

    • Set null if nullable or generate a dummy value

    ...

    Fail

    ...

    • Throw error and abort

    ...

    LENGTH

    ...

    Trim Extra

    ...

    • Trim the extra part

    ...

    Fail

    ...

    • Throw error and abort

    ...

    System Entity

    ...

    Generate

    ...

    • Generate a new UUID or FVP

    ...

    Ignore

    ...

    • Ignore this row and it’s subtree

    ...

    Replace with the conflicted row

    ...

    • Ignore this row and it’s subtree (Without the relation objects)

    • Import relation objectss but change the relation to connect to the conflicted row

    ...

    Fail

    ...

    If all the types are set to resolve at import time then the Resolve and Import button will be shown. In this case, the 3rd step is not needed anymore. Otherwise, you can proceed to the 3rd step by clicking the Gather Conflicts button.

    ...

    Info

    The current limit for gathering conflicts is 10,000.

    ...

    Resolve and Import

    Clicking the Resolve and Import button will begin the 4th and final step. In this step, the import will run again. All the conflicts gathered beforehand and conflicts gathered while running will be resolved based on the chosen solution.

    ...