Cyclic Dependencies

It is valid for a database schema to have cyclic dependencies. This means that if you follow columns linked by dependencies (defined by DBMS foreign keys or DataVeil User Dependencies) from a column then you can eventually return to the same column.

Consider the example below.

Column "col1" is a parent of "col2", and "col2" is a parent of "col3", and "col3" is a parent of "col1" which takes us back to the start and forms a dependency loop - also known as a cyclic dependency.

If you try to add a mask to a column (or set it as sensitive) when it is in a cyclic dependency then you will receive an error message. For example, if we try to add a mask to "col1" then we would see the error message below. It will list the column path that forms the cyclic dependency.


If it is required to mask a column that is in a cyclic dependency then you will need to disable one of the dependencies in the loop so that DataVeil can identify an unambiguous start (the root) of a dependency tree that has no loops. DataVeil will then mask the root column and automatically propagate those masked values to all of the dependent columns.


Disabling a Dependency

Suppose it is required to mask the columns that are in this cyclic dependency and we want to define a mask for column "col1". i.e. We want to make "col1" the root. Therefore we need to disable the dependency that makes "col1" a child. In this case, it means that we want to disable the dependency from "col3" (the parent) to "col1" (the child).

An easy way to do this is:

Step 1) Set focus to the parent column in the Project explorer tree. i.e. Click on column "col3".



Step 2) Open the Dependencies tab on the main window.


Step 3) Ensure that the "Lock Enabled column" checkbox is cleared (using this to lock the Enabled column helps ensure that dependencies aren't accidentally disabled) and then clear the "Enabled" checkbox corresponding to the dependency where "col3" is parent to "col1".


The diagram will now show the dependency arrow using a dotted line to indicate that the dependency is disabled. "col1" is now the unambiguous root to the dependency tree and all other dependencies remain intact so that "col2" and "col3" will inherit the correct masked values from any masks defined for "col1".

Note: When a dependency is disabled in DataVeil these do not affect the status of the actual foreign key definitions in the database schema. Dependency management within DataVeil is used only by DataVeil to determine how it shall proceed to mask columns.


To finish this example, if a Number Sequence mask is added to "col1" you can see that Inherit masks are automatically added to the dependent columns: