repairCollection

repairCollection(coll: Collection input);

The repairCollection method of the Application class removes invalid object references and fixes up dictionary keys in the collection specified in the coll parameter. The repairCollection method enables you to perform an online repair of a collection while it is concurrently updated, as shown in the following example.

app.repairCollection(aColl);

The repairCollection method implemented by the Application class creates and executes a background process that invokes a CollClass method to perform the repair.

To perform a repair synchronously, you can invoke the CollClass method directly, as shown in the following example.

Collection.repairCollection(aColl);

The repairCollection method records progress information and information about entries that have been corrected, in the jommsg.log file.

This method iterates the collection specified in the coll parameter and performs the following actions.

No action is taken with arrays of primitive types.

The repairCollection method differs from the Collection::rebuild method used by the JADE Logical Certifier utility in the following ways.

When there are a relatively small number of entries to be repaired in a large collection, the Application class repairCollection method is significantly faster than the Collection::rebuild method used by the JADE Logical Certifier utility and it is designed to be invoked online.

Use the Application::repairCollection method only when you know that the collection is structurally sound and that only the entries in that collection are invalid. You can obtain an indication of the structural integrity of the collection by iterating the collection and counting entries. If the iteration completes without encountering an exception and the number of entries is equal to the value of the Collection::size property, it is likely the collection is structurally sound. When in doubt about the structural integrity, use the JADE Logical Certifier utility, which uses the Collection::rebuild method. For details, see Chapter 5, "JADE Logical Certifier Diagnostic Utility", of the JADE Object Manager Guide.

Because the repair is done by a background process, you can use the repairCollection method only with committed persistent or shared transient collections.