Exemplo n.º 1
0
CRUCache::~CRUCache() 
{
	// Normally, all of the DDOL MV/table objects are in
	// the eClosed state at this point. However,
	// if the destructor is called from inside an exception 
	// handler when some DDOL object is left in the eModified 
	// state, the utility should not attempt to save the object
	// to the catalog.
	DSListPosition pos = mvList_.GetHeadPosition();
	while (NULL != pos)
	{
		CRUMV *pMV = mvList_.GetNext(pos);
		pMV->CancelChanges();
	}	

	pos = tableList_.GetHeadPosition();
	while (NULL != pos)
	{
		CRUTbl *pTbl = tableList_.GetNext(pos);
		pTbl->CancelChanges();
	}	

	// Since sqlNode_ is an object (not a pointer),
	// its destructor is called automatically,
	// therefore disposing the cloud of DD objects.

	// Since mvList_ and tableList_ *own* the referenced objects,
	// there is no need to apply the RemoveAll() method to them.
}