Bedrock.Cube.Data.Clear

Post Reply
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Bedrock.Cube.Data.Clear

Post by Alan Kirk »

Just a little warning in case anyone else gets hit in the face with this like I just did.

A couple of years back we had some contractors in who implemented a system using Bedrock. Cool, no problem, there are far worse ways of doing things. Though it's only recently that I've started to spread it to our legacy servers. Version 3 is now out but I opted to stay with version 2 since I didn't want to run the risk that anything had changed in version 3 that might break the aforementioned system. So by downloading the version 2 package and installing that on the other servers I was playing it safe. Or so I thought.

Now, call me old fashioned but I was once told that you should look upon a function signature as a "contract" between the developer and the people using their functions, such that you do not change the terms of that contract. Sure, expand arguments if you want to add new features in later versions, but the original ones should remain inviolate.

So when I wrote some new standard cross-server code I was a tad surprised to hear "BOOOOOMMMM!!!" coming out of the server log file with:

Code: Select all

7128   [2]   ERROR   2015-03-08 22:16:33.238   TM1.Process   Parameter "pRetainTempObj" not found in process "Bedrock.Cube.Data.Clear"
7128   [2]   ERROR   2015-03-08 22:16:33.254   TM1.Process   Process "MyProcess'Name": : Could not initialize process
What the...?

So I took a look at the process on the contractor-built server (where I developed the new standard code), and then on the legacy server that I had installed Bedrock on and lo:
BedrockCubeDataClear.JPG
BedrockCubeDataClear.JPG (169.46 KiB) Viewed 2950 times
Ooooh-kay, that explains the "Boom". So I took a look at the Prolog and found that the contractor-built version was 2.0, while the one that I had downloaded was 2.0.2. But surely there was at least a warning about this in the documentation? Er, no. In fact the documentation uses the parameter name pDeleteTempObj, which obviously doesn't appear in either version. And as demonstrated above TI does not like to be told to use arguments which don't exist.

I could of course update the contractor-built server to use the 2.0.2 process, but that would cause me to wonder what else would break and which I wouldn't know about until it did. But of course if I don't then the new standard code will only work where 2.0 is installed. Though fortunately in this case omitting the argument entirely and using the default will work for my purposes. It may not work for yours.

Rock => Me <= Hard Place.

Time to hit Notepad ++ and see which other processes make a call to version 2.0 of Bedrock.Cube.Data.Clear. Ah 127 hits. Oh goodie.

This is not likely to be the least frequently used function in the library (as per above), so I thought this would be a relevant warning for any Bedrock users who are upgrading to a newer version.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Bedrock.Cube.Data.Clear

Post by Alan Kirk »

Aaaand somewhere between 2.0 and 2.0.2 it seems that the functions:
- Bedrock.Dim.Sub.Create.AllLeafElements and
- Bedrock.Dim.Sub.Create.AllLeafElements.AllDimensions
were dropped without mention in the documentation.

(Yes, "Booom" again. My server log file is starting to sound like a percussion band.)

This is a relatively easy fix given that the former at least is just a wrapper around Bedrock.Dim.Sub.Create but again, beware if using them in your own code.

Edit: Except for the fact that the version 1.0 Bedrock.Dim.Sub.Create process which was installed with the 2.0 processes had an additional parameter called pAlias which had vanished by the version 2.0.2 one, so when you make the call with that in it, you know the rest.

Is one familiar with the expression "DLL Hell"? Same principle.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Post Reply