Reconnect Process for Unmodified Occurrences

No Database Connection

Uniface does the following for all disconnected occurrences with modification status est and no connection to the database:

  1. Uniface searches for the occurrence in the component using the disconnected occurrence Id.
  2. If the occurrence exists in the component, the reconnect process continues at step 4.
  3. If the occurrence does not exist in the component, Uniface recreates the occurrence using the same disconnected occurrence Id. Field data is copied from the disconnected occurrence. The reconnect process continues at step 5.
  4. No field data is copied from the disconnected occurrence.
  5. Occurrence modification flags are set to Unmodified ($occmod=0, $storetype=0).
  6. Field modification flags are set to Unmodified ($fieldmod=0), ignoring any other initial value.
  7. No CRC checking is done and no validation triggers are fired.
  8. The disconnected occurrence is deleted, and the retrieve/reconnect process continues with the next disconnected occurrence.

With Database Connection

Uniface does the following for all disconnected occurrences with modification status est and a connection to the database:

  1. Uniface searches for the occurrence in the component using the disconnected occurrence Id.
  2. If the occurrence exists in the component, the reconnect process continues at step 6.
  3. If the occurrence does not exist in the component, Uniface searches for the disconnect occurrence in the database using the primary key. The read trigger is fired.

    Note: The first occurrence read from the database is added after the first disconnected occurrence in the component. $curocc therefore returns the value 2 and not 1 (as one might expect). The subsequent occurrences will be added after the previous reconnected and before the next disconnected occurrence, which means that $curocc will return 2 when the second occurrence is read from the database (the second disconnected occurrence has the sequence number 3 before it is reconnected).

    Caution: Incorrect ProcScript code in the read trigger might cause Uniface to fail while retrieving the occurrence from the database, resulting in unexpected behavior of the reconnect process.

  4. If the occurrence exists in the database, it is loaded into the component. The reconnect process continues at step 6.
  5. If the occurrence does not exist in the database, meaning that it is removed in a separate transaction, it is not recreated.

    Note:  The disconnected is not modified in this transaction and therefore considered not to be relevant. The reconnect process continues at step 10.

  6. No field data is copied from the disconnected occurrence.
  7. Occurrence modification flags are set to Unmodified ($occmod=0, $storetype=0).
  8. Field modification flags are set to Unmodified ($fieldmod=0), ignoring any other initial value.
  9. No CRC checking is done and no validation triggers are fired.
  10. The disconnected occurrence is deleted, and the reconnect process continues with the next disconnected occurrence.

Related Topics