COS_RECREATE_OBJECTS

Syntax

int_val = COS_RECREATE_OBJECTS( );

Return Values

Success:
int 0 Objects recreated successfully.
Failure:
int -1 Script interface error.

Description

This function allows the recreation of recently deleted COS objects with same object IDs the original objects had.

The following restrictions apply:

  • All objects recreated with one call of COS_RECREATE_OBJECTS must be from the same database. Any one object in a different database causes the operation to fail. To recover objects from both library and project database, two separate calls must be made.

  • All objects must have existed in the database, and must have been deleted recently. An object with completely unknown COS oid, or an object that still exists causes the operation to fail.

  • The objects must not be in sarcophagi, ie. that the deletion of the object has happened during the past two weeks.

  • Info about who created the object, and when it was created is set to values at the recreation moment, and not to values the initial, deleted incarnation of the object had.

  • The recreation is only possible at the root server of the database.

  • After recreation the object is set to a special recovery state. The object should not be checked out, or its ownership requested to replicas before the resurrection of the object has been replicated to the whole replication network.

  • Each object must be present in the file only once - multiple entries for the same object cause the operation to fail.

  • The function does not restore the possible COS server files associated with the objects. Recovery of the associations needs to be done manually.

Do the following:

On a separate computer:

  1. Install the COS server from a recent backup (BUP) file where the objects still existed. This needs to be done on a separate computer.

  2. Start debug databases from ManageCODesigner for the restored COS server.

  3. Collect objects to recover using the Cart function.

  4. In Cart in debug databases, select the objects in the cart and right-click the objects. Select Administrative Commands > Create a dump file of selected objects from the context menu.

  5. Choose a file name for the object dumps.

Using the original environment:

  1. Create the following kind of script file:

    Copy
    extern COS_RECREATE_OBJECTS;

    main()
    {
            COS_RECREATE_OBJECTS("C:/temp/dumps.txt");
    }

    Here, the file name argument of COS_RECREATE_OBEJCTS is the path to file created in step 5 of the previous section.

  2. From Cadmatic desktop, select Object > Tools > Run DM tools to start DM Tools, then select Select and Run Script to start the script created in step 1.

Deleted objects should re-appear in the COS server.