Reconnect Process for Deleted Occurrences

No Database Connection

 Uniface does the following for all disconnected occurrences with modification status del 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.
  4. Field data is copied from the disconnected occurrence, modifying the occurrence.
  5. The occurrence is deleted from the component (similar to the ProcScript statement remocc), which will set the occurrence modification flags to Deleted ($occdel=1).

    Note:  Up occurrences are not deleted for up entities with an empty DELETE_UP trigger.

  6. 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 del 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 9.
  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. The occurrence is deleted from the component (similar to the ProcScript statement remocc), which will set the occurrence modification flags to Deleted ($occdel=1).

    Note:  Up occurrences are not deleted for up entities with an empty DELETE_UP trigger.

  10. The disconnected occurrence is deleted, and the reconnect process continues with the next disconnected occurrence.

Related Topics