$TEST_MODE_COMPONENTS

Allow the most recently compiled component to be instantiated in a running application.

$TEST_MODE_COMPONENTS {= } 1 | 0

Defaults

Assignment file: Any application assignment file
Section: [SETTINGS]
Default value: 0

Description

$TEST_MODE_COMPONENTS enables Uniface to use the most up-to-date component when an application is running. This means that if a component is changed in the Uniface IDE and is compiled while the application it belongs to is running, the new component file can immediately be used without needing to restart the application.

However, Uniface continues using the old component descriptor until all instances of the component have been closed. The next time a new instance of the component is created, it uses the new descriptor.

Note:  If you use xmlload in combination with $TEST_MODE_COMPONENTS, it can happen that additional ‘Field not found’ warnings (visible in the message frame) are issued, which might significantly increase Uniface’s memory usage.

This setting works seamlessly for components that have not had any interface changes. However, with components that have had changes to their interface, such as a change in the data type of an operation’s parameter, the addition of a new operation, or the removal of a parameter, this functionality causes a mismatching unique ID error (-51 in $status) in several situations which prevents the component from being instantiated. The following sections describe how to avoid these errors.

Components with a Changed Interface

When a component has an interface change, a new unique ID is generated. This causes an error when a new instance is created using the new version of the component. This is because the unique ID on the signature is compiled into the component file, but the unique ID for the component in the UAR does not change. To avoid this error, you must generate a new descriptor in the UAR.

Instantiating a New Component Version without Closing Existing Instances

If you are using $CHECK_SIGNATURE_ID (to enable checking of signature ID when activating components), an error occurs (-51) in $status) if you instantiate a new version of a component whose unique ID has changed (due to interface changes) before you have closed all the existing component instances. This occurs because Uniface detects a mismatch between the component ID on the file and that of the old descriptor. To avoid this error without closing all of the existing component instances, you must remove $CHECK_SIGNATURE_ID.

Instantiating a Component with the Keep data in Memory Property

A mismatching unique ID error (-51 in $status) is caused when a component has the Keep data in memory property set to true, you are using $CHECK_SIGNATURE_ID, and all of the following steps are taken:

  1. The component is instantiated and then deleted (using deleteinstance).
  2. Component interface is changed
  3. Component is recompiled
  4. UAR containing the descriptor is rebuilt
  5. The instance of the component which was deleted in step 1 is reopened.

The error occurs because the application will continue using the old component file (due to the Keep data in memory property), but will use the new component descriptor (which has a new unique ID). If a new instance is created, there is no error because both the new component file and the new descriptor are used. To avoid the error, remove $CHECK_SIGNATURE_ID.

Related Topics