Reconnect Process

The reconnect process merges data in disconnected occurrences with data in the component, and resolves the state information that is stored in the modification status attributes. It removes duplicates of occurrences, removes occurrences marked for deletion from the component, and sets the appropriate modification flags.

A disconnected occurrence is an occurrence in a component that has been loaded from a disconnected record set, and is not yet reconnected. Disconnected occurrences are new occurrences ($occmod=1 and $storetype=1) for which occurrence metadata is available.

The reconnect process can be initiated by either the reconnect or retrieve/reconnect Proc commands.

Each time you load data from a disconnected record set into a component with data from a database, you should follow it with a reconnect command. If a reconnect command is not used, there is no distinction made between modified and non-modified occurrences.

For each disconnected occurrence, the procedure followed during the reconnect process depends on the modification status (which can be examined using $occstatus) and whether the data in the component is connected to a database.

The following table provides an overview:

Modification Status of Disconnected Occurrences

Occurrences

Status Attribute

Meaning

Unmodified occurrences

"est"

Occurrence exists in the database and has not been modified since retrieval in the current transaction.

Modified occurrences

"mod"

Occurrence exists in the database and has been modified since retrieval in the current transaction.

Deleted occurrences

"del"

Occurrence exists in the database and should be deleted from the component and database in the current transaction.

New occurrences

"new"

Occurrence does not exist in the database and should be created in the component and the database in the current transaction.

No modification attribute

""

Occurrence has no modification state and declares that it is not relevant.

Non-disconnected occurrences

N/A

The reconnect process does not affect occurrences that are not disconnected.

Empty Elements

A disconnected record set can contain elements that represent a subset of the entity fields. During reconnect, field values are modified if the field is represented in the disconnected record set. If the field is represented as an empty element, the field is emptied during reconnect. If the field is not represented in the disconnected record set, the field is not modified.

Caution:

Included entities are an exception. The fields of included entities are emptied if the field is not represented by an element in the disconnected record set. All the fields of the included entity must be included, otherwise data is lost during reconnect.