Exemplo n.º 1
0
void CRUCache::FetchSingleInvolvedMV(CDDMV *pddMV)
{
	CRUMV *pMV = new CRUMV(pddMV);

	pMV->SetInvolved();	

	// Read the REFRESH-specific metadata 
	pMV->FetchMetadata();

	// Take care not to cancel the dangling DDL lock accidentally.
	// For example, if the MV is multi-transactional, and has a 
	// DDL lock following the previous Refresh failure - it is 
	// forbidden to remove the DDL lock as long as the MV is not
	// refreshed successfully.
	pMV->SetReleaseDDLLock(pddMV->CanCancelDDLLock());

	// Ignore User Maintainable MVs.
	if (CDDObject::eBY_USER == pMV->GetRefreshType())
	{
	  delete pMV;
	  return;
	}

	mvList_.AddTail(pMV);

	// Register the MV for the further DDL lock handling
	ddlLockHandler_.AddObject(pMV);

	if (TRUE == isCancelOnly_)
	{
		return;
	}

	// Retrieve whether the user has Insert/Select/Delete privilege for this MV
	pMV->FetchPrivileges();
}