Fix to avoid deleting cached CDB objects - modified fix by Peter.