RESOLUTION
To resolve this problem, you must use the Decision Support Objects (DSO) Process
(ProcessSuspendLazyProcessing) method to suspend lazy processing while you merge partitions. When you have finished merging partitions, you must use the DSO Process
(ProcessResumeLazyProcessing) method to resume lazy processing.
To suspend lazy processing by using the DSO Process
(ProcessSuspendLazyProcessing) method, and to resume lazy processing by using the DSO Process
(ProcessResumeLazyProcessing) method, use code that is similar to the following code.
Function IncrementalPartitionProcess(dsoCube As DSO.Cube, dsoPartition As DSO.Partition) As Boolean
On Error GoTo Erreur
Dim bRes As Boolean
Dim bSuspendedLazyProcessing As Boolean
Dim dsoDatabase As DSO.Database
Dim dsoPartTemp As DSO.Partition
bRes = True
IncrementalPartitionProcess = bRes
If m_bError Then Exit Function
Set dsoDatabase = dsoCube.Parent
'Create a temporary partition
Set dsoPartTemp = dsoCube.MDStores.AddNew("~" & dsoPartition.Name)
dsoPartition.Clone dsoPartTemp
m_oLog.AddLog LOG_LEVEL01, LOG_TYPE_INFO, "IncrementalPartitionProcess", "Partition[1] Temp" & dsoPartTemp.Name
ProcessObject m_oDsoServer.MDStores(m_sOlapDatabase), "P", dsoPartTemp, Nothing, processFull
m_oLog.AddLog LOG_LEVEL01, LOG_TYPE_INFO, "IncrementalPartitionProcess", "Partition[2] Temp" & dsoPartTemp.Name
' Verify the merge results
If (dsoPartTemp.State <> olapStateNeverProcessed) Then
'If (dsoPartTemp.EstimatedSize > 0) Then
m_oLog.AddLog LOG_LEVEL01, LOG_TYPE_INFO, "IncrementalPartitionProcess", "Partition[3] Merge" & dsoPartTemp.Name
dsoDatabase.Process processSuspendLazyProcessing ' 106
bSuspendedLazyProcessing = true
dsoPartition.Merge dsoPartTemp.Name
dsoDatabase.Process processResumeLazyProcessing ' 107
bSuspendedLazyProcessing = false
m_oLog.AddLog LOG_LEVEL01, LOG_TYPE_INFO, "IncrementalPartitionProcess", "Partition[4] Merge" & dsoPartTemp.Name
'Else
' m_oLog.AddLog LOG_LEVEL01, LOG_TYPE_ERROR, "IncrementalPartitionProcess", "Partition " & dsoPartTemp.Name & " size is empty"
' bRes = False
'End If
Else
m_oLog.AddLog LOG_LEVEL01, LOG_TYPE_ERROR, "IncrementalPartitionProcess", "Partition " & dsoPartTemp.Name & " has abnormal state. Partition must be processed."
m_bError = True
bRes = False
End If
Set dsoPartTemp = Nothing
IncrementalPartitionProcess = bRes
Exit Function
Erreur:
m_oLog.AddLog LOG_LEVEL01, LOG_TYPE_ERROR, "IncrementalPartitionProcess", "Error: " & Err.Number & "(" & Err.Description & ")"
If (bSuspendedLazyProcessing)
dsoDatabase.Process processResumeLazyProcessing ' 107
End If
Set dsoPartTemp = Nothing
IncrementalPartitionProcess = bRes
m_bError = True
End Function ' IncrementalPartitionProcess