The basic support for constraints is used for the following scenarios:
-
A new data group that is part of an application group and is explicitly configured to use single-threaded database apply processing. (This is indicated by a numeric value for the Number of database apply sessions (NBRDBAPY).)
-
A new data group that is configured without an associated application group (a standalone data group).
-
An existing data group that existed prior to upgrading to MIMIX version 9.0 and either:
-
Is not associated with a resource group, or its resource group has not been converted to use multithreaded database apply processing.
-
Used target constraint management before upgrading and has been changed after the upgrade to no longer use it.
-
Unique, primary key, and check constraints are associated with a single file and operations associated with them are replicated directly by MIMIX. For these types of constraints, if a constraint is met for a database operation on the source node, the same constraint will be met for the replicated database operation on the target node.
Referential (foreign key) constraints ensure integrity between two files. When foreign key constraints are added, removed or changed on source node files that are replicated by data groups which perform cooperative processing of *FILE objects, the target node files retain the same constraint setting (enable or disable) as the source files. When a referential constraint is created as part of an SQL CREATE TABLE statement, the apply session assigned for the new table (*FILE) will be the same apply as the file to which it is constrained. When a clear pending start of the data group is performed, MIMIX moves replicated files that are constrained together into the same database apply session to avoid constraint violations, locking issues, and other constraint-related replication issues that might arise when files referenced by a constraint are in different apply sessions.
To ensure that the target node can use all of the IBM i constraint functions available on the source node, the target node must be running the same or a higher release level of the IBM i operating system as the release running on the source node. If the target node runs on an earlier release, operations associated with constraints which are not supported on that release level will be ignored.
MIMIX always automatically disables foreign key constraints on target node files in these scenarios:
-
When replication activity has been placed on hold for a file.
-
During the recovery phase of a virtual switch.
When the hold is released or the virtual switch recovery phase completes, the target node constraints are returned to their previous state, matching that of the source node.