Last modified on 19 April 2024, at 08:22

Database View Creation

Revision as of 08:22, 19 April 2024 by NWE (Talk | contribs)

UBIK 4++ (Dynamic Live Mode) creates on the database an entity model which is not human readable. Both, the creation of tables as well as the creation of columns uses an intern naming mechanism which is based on object ids and not on object names. To enable system administrators as well as 3rd party systems to consume UBIK data using database mechanism, UBIK provides a mechanism which gives (read) access to the UBIK data via database views. The naming conventions used for the views as well as for the used columns are compatible to the naming conventions used in prior UBIK versions.

Overview

The creation of the views must be enabled once for every UBIK database (project). After the mechanism was enabled the initial creation of the views must be triggered manually. Once this is done, the system takes care about keeping the views up to date (all changes in the data model will reflect in updates of the view structures just in time). If the system runs into an unexpected situation it will change the status and will stop to automatically update the views. A conflict must be solved manually by the administrator.

Automatic Creation of Views

Configuration

The configuration is done using the System Settings dialogue. You have to configure the following settings:

Name Description
View Creation Target The database instance in which the views will be created. It must not be the same instance like the current UBIK instance. I suggest to have either one separat instance per UBIK project or one Instance for multiple projects.
View Creation Database Login Database User which is used for creating the views. If this setting is empty, the system uses the same credential information as for the current UBIK Project.
View Creation Database Password Database User which is used for creating the views. This setting is only used if the View Creation Database Login is not empty.
View Creation Database Use Windows Authentication Possibility to configure whether the current OS Login should be used when connecting to the database Instance. Set this value to false, if you want to reuse the credentials information from the current UBIK Project.
View Creation Prefix Prefix for the current project which will be added to every single view name. The prefix must be a 3 character (no special characters) indicator for the current project. If you plan to have the views of multiple projects hosted in one database Instance, this value must be unique.
IC Attention.pngSettings can only be configured while the View Creation is disabled!
IC Attention.pngAfter changing the View Creation Target field we recommend disabling the View Creation and restarting UBIK.Studio (as settings are read during the initialization of the system).

Enabling and Disabling the View Creation

There is a button for enabling and disabling the view creation, located at the bottom of UBIK® Studio.

It governs the setting for enabling and disabling database view creation and makes sure to create or update the views if necessary.

View Creation button

Name Description
View Creation Status To enable the automatic view creation you have to set the setting to "Enabled". "Disabled" will disable the mechanism. "Error" indicates that there was an error during the creation and the mechanism has stopped working.

Prior to UBIK version 4.7, the views can be created and dropped by code.

  bool result = anyUbikObject.Environment.UBIKDataFactory().CreateAllViews();
  bool result = anyUbikObject.Environment.UBIKDataFactory().DropAllViews();

Further, to enable the view creation, the respective setting has to be set to "Enabled" manually.

Resolving an Error in View Creation

If the setting has changed to "Error" the system indicates that there was an error during the creation of views. You will find detail information about what has happened in the corresponding exception a/o Error Logs. Please fix the source of the problem in the data structure before enabling the view creation.

See also