Deleting virtual document components

You cannot destroy a component that is still in a virtual document while compound_integrity is on. Unhook it with the VD API first. Folders are not components; see virtual documents.

Which VDs hold this object

dmr_containment.component_id stores the component’s i_chronicle_id, not necessarily the version you have in hand. Look up the chronicle, then the parents:

select r_object_id, object_name, r_object_type
from dm_sysobject (all)
where r_object_id in (
  select parent_id
  from dmr_containment
  where component_id in (
    select i_chronicle_id
    from dm_sysobject (all)
    where r_object_id = '09xxxxxxx'
  )
)

Do not filter on a production object_name in published examples. Resolve the id first, then use 09xxxxxxx as the stand-in.

List parts and contain_id

IN DOCUMENT on the VD root. contain_id is the dmr_containment object (type tag 05):

select r_object_id, contain_id, object_name
from dm_sysobject
in document id('09xxxxxxx')

removepart

IAPI / DFC: virtual-document id, then containment id. That removes the link. It does not destroy the component object.

removepart,c,09xxxxxxx,05xxxxxxx

Repeat for every parent from the first query. Then destroy the component if you still need it gone. If a parent is frozen, unfreeze it first (r_frozen_flag).

compound_integrity (last resort)

If destroy still fails with “referenced by another compound document,” a parent is still linked, or the containment row is leftover. Fix the containment. Only if you have exhausted that, dm_server_config.compound_integrity can be turned off for a short window. Boolean in IAPI is T / F (not the strings TRUE/FALSE).

retrieve,c,dm_server_config
set,c,l,compound_integrity
F
save,c,l
reinit,c

Destroy what you must, then set it back to T, save, reinit. Leaving it F in production lets people break VD trees. Do this in a maintenance window, not as a standing config.

IDs: 09xxxxxxx document, 05xxxxxxx containment. Rest is x because those digits include the docbase id.