Reconnect Process for Modified Occurrences

No Database Connection

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

  1. Uniface searches for the occurrence in the component using the XML 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.
  4. Field data is copied from the disconnected occurrence, modifying the occurrence.
  5. Occurrence modification flags are set to Modified ($occmod=1, $storetype=0).
  6. Field modification flags are set to Modified ($fieldmod=1) for fields of which the content differs from the original.
  7. The disconnected occurrence is deleted, and the reconnect process continues with the next disconnected occurrence.

With Database Connection

Uniface does the following for all disconnected occurrences with modification status mod 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.

    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, the error trigger ($error=2013) is fired. The occurrence is not recreated. The reconnect process continues at step 11.
  6. Uniface compares the CRC value of the disconnected occurrence with the CRC value of the occurrence. If the CRC values do not match, meaning that the occurrence is modified in a separate transaction, the occurrence cannot be reconnected and the error trigger ($error=2012) is fired. The reconnect process continues.
  7. If cautious locking is used, the occurrence is locked.
  8. Field data is copied from the disconnected occurrence, modifying the occurrence.

    Note:  Fields are not copied for up entities with an empty WRITE_UP trigger.

  9. Occurrence modification flags are set to Modified ($occmod=1, $storetype=0).
  10. Field modification flags are set to Modified ($fieldmod=1) for fields of which the content differs from the original.
  11. The disconnected occurrence is deleted, and the reconnect process continues with the next disconnected occurrence.

Related Topics