Loading and unloading relationships

With the repos_copy utility, you can load and unload specified relationship definitions in the repository.

Note:
You can also use repos_copy to load and unload map definitions in the repository. For more information, see "Importing and exporting maps from InterChange Server Express".

Unloading a relationship definition

With the repos_copy utility, you can unload specified relationship definitions in the repository with the -e option. A relationship repository file is the file that the repos_copy utility creates when it extracts a relationship definition from the repository into a text (.jar) file.

For example, the following repos_copy command unloads the StateLk relationship definition from the repository of an InterChange Server Express named WebSphereICS into a relationship repository file:

repos_copy -eRelationship:StateLk -oRL_StateLookup.jar 
 -sWebSphereICS -uadmin -pnull
 
Attention:
A relationship is not a first-class entity. Therefore, its name space is separate from the first-class entities. While no first-class entities can have the same name, a relationship can have the same name as a first-class entity (such as a business object or collaboration). However, if a relationship definition has a name that matches any existing first-class entity, you cannot use the -e option of repos_copy to unload or load that relationship definition. You can load and unload the entire repository, which includes relationship definitions.

You can copy several relationship definitions into one relationship repository file. For example, to copy both the StateLk and CustLkUp relationship definitions, use the following repos_copy command:

repos_copy -eRelationship:StateLk+Relationship:CustLkUp 
 -oRL_Lookup_Relationships.jar -sWebSphereICS -uadmin -pnull
 

Loading a relationship definition

You can also use repos_copy to load a relationship definition into the repository from a relationship repository file. The following repos_copy command loads the StateLk relationship definition into the repository of an InterChange Server Express named WebSphereICS:

repos_copy -iRL_StateLookup.jar -sWebSphereICS -uadmin -pnull
 

The repos_copy utility performs the following validations when it loads a relationship definition:

If repos_copy cannot perform both of these validations, it cannot load the relationship definition. However, repos_copy provides special command-line options to suppress or restrict these validations, as the following sections explain.

Validating the database URL

The repos_copy utility provides the -r option to assist in loading relationship definitions into a repository. The -r option tells repos_copy to add relationship definitions to the repository without creating their run-time schemas. When repos_copy backs up an entire repository (with the -o option), some of the information in the resulting repository text file describes relationship definitions. If you then use repos_copy (without the -r option) to load a different repository with the contents of this repository text file, repos_copy might generate errors of the following format when it attempts to load the relationship definitions:

Server error: An error occurred during the validation of the runtime database
 connection information for relationship definition Customer. The database URL 
 used is: jdbc:weblogic:mssqlserver4:Cwrelns312@CWDEV:1433. The database 
 login name used is: crossworlds. The database type used is: W55s/wPE/l4=1. 
 Reason: SqlServer.
 

The cause of this error is repos_copy's attempt to validate the URL for the relationship database. Part of a relationship's definition is the Database URL of the relationship database.

If repos_copy cannot find the relationship database, it generates an error and rolls back the repository load. If you are just backing up and restoring on the same InterChange Server Express (with the same relationship databases), you do not need to include the -r option. Validation of the relationship database URL succeeds because the database URLs can be located. Therefore, the repository load (including the relationship definitions) is successful.

However, in the import process of a migration when you are moving repository data from one machine to another, the -r option can be helpful. If you execute the repos_copy command in an environment that cannot locate any existing relationship databases in the repository data, repos_copy generates the validation error. To suppress this validation, include the -r option of repos_copy when you load the repository. By suppressing this validation, repos_copy can successfully add the relationship definitions to the repository. It uses the current repository database as the location for the relationship database. You can then use Relationship Designer Express to change the Database URL to point to the appropriate location of each relationship database.

The following repos_copy command loads the StateLk relationship definition into the repository, suppressing the validation of its Database URL:

repos_copy -rStateLk -iRL_StateLookup.txt -sWebSphereICS -uadmin 
 -pnull
 

Validating dependent objects

By default, repos_copy validates whether all dependent objects exist when it loads a relationship definition. For example, it checks that all business objects involved in the relationship exist in the repository. If all dependent objects do not exist, repos_copy generates an error and rolls back the repository load. In the repos_copy command window, the following message is displayed:

Some of the participants for relationships were missing. 
 For more info, refer to InterChange Server Express log file. 
 

Copyright IBM Corp. 2003