Martin Ryan wrote:lotsaram wrote:All dimension updates on the prolog are comitted INSTANTANEOUSLY to memory (and to disk).
This is news to me. I thought all metadata updates were done at the close of the metadata tab.
Is this a change, or has it always been this way?
Yeah, due respect to Lotsa but I'm afraid I must disagree on this one. My understanding of dimension changes, based on work with the API which is I imagine not too different from how TI does it, is that you create a copy of the dim in memory, make the changes on the copy, then overwrite the original. This is, I believe, what happens at the end of the Metadata tab (and possibly the Prolog tab as well, but I haven't tested that). Instantaneous changes using that methodology would seem to hammer the system a bit hard.
Consider the following two processes:
Process 1 Prolog
Code: Select all
s_DimName = 'z_Test';
DimensionCreate(s_DimName);
DimensionElementInsert(s_DimName, '','Element 1','N');
ExecuteProcess( 'zTest2', 'Call', 'Prolog');
l = DimSiz ( s_DimName);
AsciiOutput ( 'C:\Temp\TestDimProc1.txt', NumberToString ( l ) );
Process 1 Epilog
Code: Select all
ExecuteProcess( 'zTest2', 'Call', 'Epilog');
Process 2 Prolog
Code: Select all
s_DimName = 'z_Test';
s_OutputFile = 'C:\Temp\TestDimProc' | Call | '.txt';
l = DimSiz ( s_DimName);
AsciiOutput (s_OutputFile, NumberToString ( l ) );
Now, what you get out of these is:
Prolog call to Process 2 (and its AsciiOutput) = 0
Call to Process 1's AsciiOutput = 1
Epilog call to Process 2 (and its AsciiOutput) = 1
This makes sense. What appears to be happening is that the
copy of the dimension that Process 1 is (presumed, by me at least to be) working on does indeed have one element. Consequently the Prolog AsciiOut of that process shows 1. The
copy is updated in real time... but that's not the dimension that the rest of the system knows about.
Consequently at the time that the Prolog call to process 2 is done, process 2 knows nothing of any such elements and returns 0. (NB: For some reason doing a DimSiz on a non-existent dim doesn't cause an error (in 9.5.2 at least), it just returns 0. My belief is that process 2 doesn't even know the new dim exists yet because it hasn't been registered. Certainly it clearly doesn't know anything about an element in that dim,even though the element was "created" before the call was made.)
However the Epilog call to Process 2
does know about the element, because, I believe, the dimension was registered either at the end of the Prolog tab or as the process slipped over the Metadata stage. (Neither process had a data source.)
Edit: Incidentally, an AsciiOutput in Process1's Prolog
before the call to Process 2 will also yield "1".