Partial cube process from code - Invalid handle error -
06-13-2005
, 07:06 AM
Hi,
I wonder if anyone can help me with the following. I have a cube which
periodically runs the c# code below to do a partial update, importing
new rows from the fact table into the cube. Yesterday it failed when
issuing the command to merge the temp partitions with the permanent
one, stating that a handle was invalid.
// Create temporary partition
DSO.Partition lClonePartition;
lPartitionName = "~" + lPartition.Name;
lLog.Append("\n Add new temporary partition");
lClonePartition =
(DSO.Partition)lCube.MDStores.AddNew(lPartitionNam e,
DSO.SubClassTypes.sbclsRegular);
// Clone the main partition to the temporary one.
lLog.Append("\n Clone existing partition to temporary partition");
lPartition.Clone((DSO.ICommon)lClonePartition,
DSO.CloneOptions.cloneMinorChildren);
lLog.Append("\n Set temporary partition filter");
lClonePartition.SourceTableFilter =
"\"dbo\".\"tAnswerFact\".\"fact_ClientID\" = " + xiClientId +
" AND \"dbo\".\"tAnswerFact\".\"fact_Imported\" = 1";
lLog.Append("\n CommitTrans 2");
lDatabase.CommitTrans();
// Process the temporary partition.
lLog.Append("\n BeginTrans 3");
lDatabase.BeginTrans();
lLog.Append("\n Process temporary partition");
lClonePartition.Process(DSO.ProcessTypes.processDe fault);
lLog.Append("\n CommitTrans 3");
lDatabase.CommitTrans();
// Merge the two partitions.
lLog.Append("\n BeginTrans 4");
lDatabase.BeginTrans();
lLog.Append("\n Merge the two partitions");
lPartition.Merge (lPartitionName);
lLog.Append("\n Set existing partition filter");
lPartition.SourceTableFilter =
"\"dbo\".\"tAnswerFact\".\"fact_ClientID\" = " + xiClientId;
lLog.Append("\n Update partition");
lPartition.Update();
lLog.Append("\n CommitTrans 4");
lDatabase.CommitTrans();
This all usually works fine, adding rows to the cube which have
fact_Imported = 1. However last night the partial process failed with
a file error. Our logs showed the following output:
Add new temporary partition
Clone existing partition to temporary partition
Set temporary partition filter
CommitTrans 2
BeginTrans 3
Process temporary partition
CommitTrans 3
BeginTrans 4
Merge the two partitions
File error [Read error] 'C:\Program Files\Microsoft Analysis
Services\Data\XYZ_OLAP_Cube_DB\XYZ_OLAP_Cube_ABC_D EFGHI_JKLMNOPQR_STUVWXYZA
\XYZ_OLAP_Cube_ABC_DEFGHI_JKLMNOPQR_STUVWXYZA.1.fa ct.map The
handle is invalid. The handle is invalid.
Has anyone else seen this error when merging two partitions? Does
anyone know what causes the error, which looks like a problem internal
to Analysis Services? Any workarounds to stop this happening again?
Thanks in advance for any help you can offer,
Tom Steer |