TM1 API Element Security

Post Reply
TomBr
Posts: 32
Joined: Tue Jun 03, 2008 6:56 pm

TM1 API Element Security

Post by TomBr »

Hi,

We are having an issue with TM1 9.1 API's on 64 bit.

We are updating an application that was originally written in TM1 V6 API but currently being used in TM1 v8.4 (32 bit)

The problem is with updating Element Security. In version 8 it takes minutes compared to hours in v9 for approximately 250,000 records of Element\Group combinations.

The API being used is TM1ObjectSecurityRightSet.

Any ideas would be appreciated.

Tom
User avatar
Mike Cowie
Site Admin
Posts: 483
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: TM1 API Element Security

Post by Mike Cowie »

Hi Tom,

First question - is there a way you could update your element security through a TI process or through TM1 Rules (which are both options in TM1 9.1)? That would likely be far faster and ultimately easier to support. If you can do something in TI, for example, instead of the TM1 API then that is far preferable in my opinion, at the very least because the process would run at the server.

If that isn't possible, have you done some profiling/benchmarking of your upgraded (to 9.1 API) code to see where most of the time is being spent? Is there any chance you can post a relevant snippet of code? In particular, it would be good to see what you do within the following block of code (I'm highlighting the TM1 API-specific pieces here):

-- Previously grabbed data from 1 of 250,000 records --

* Do something to get handles to elements/groups
* Call TM1ObjectsSecurityRightSet to update security
* Check the result of the update

-- Grab next record and repeat --

Depending on what your code looks like there may be some tips you can use to speed things up. I will caution you that anything with TM1 9.1 will likely be slower than 8.4 if you were to do a side-by-side comparison. However, going from minutes to hours shouldn't be the magnitude of difference you would see.

Regards,
Mike
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
speedy
Posts: 4
Joined: Fri Jan 30, 2009 7:01 am

Re: TM1 API Element Security

Post by speedy »

Hello,

I have a similar problem with deleting elements. Instead of minutes it take several hours to delete the elements from a dimension.

DummyDim = TM1ObjectDuplicate( pLocal, voDim ) ;

voElementCount = TM1ObjectListCountGet( pLocal, DummyDim, TM1DimensionElements() ) ;
iElementCount = TM1ValIndexGet( hUser, voElementCount ) ;

for ( i=iElementCount-1; i>=0; i-- )
{
TM1DimensionElementDelete( pDelEle,
TM1ObjectListHandleByIndexGet( pGeneral, DummyDim, TM1DimensionElements(), TM1ValIndex( pLocal, i+1 ) ) ) ;
}

TM1ValPoolGet( pDelEle, 0 ) ;
TM1ValPoolDestroy( pDelEle ) ;
TM1ValPoolDestroy( pGeneral ) ;

Does anyone have some idea how to do that better?
Thanks
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: TM1 API Element Security

Post by Steve Vincent »

TI without doubt. If you have inherited the API code from a v6 model and it was also being used in v8.4, i would definately spend time on replacing some of that with TIs instead. TI was not available in v6 and that would have been why the API was used, but TI is quite possibly a better option now. So far i've not had to use the API for anything :)
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
User avatar
paulsimon
MVP
Posts: 808
Joined: Sat Sep 03, 2011 11:10 pm
OLAP Product: TM1
Version: PA 2.0.5
Excel Version: 2016
Contact:

Re: TM1 API Element Security

Post by paulsimon »

Hi,

I agree with Steve, and I wrote the TM1EasyAPI. If you want to do any dimension maintenance, then you are better off using TI and just using the API to execute the TI Process and pass in parameters. From what I have heard Applix doesn't use the published API for dimension maintenance in TI, which is probably why TI is so fast.

There may also be particular issues in 9.1. We have been having tremendous performance issues with ElementAttributes in 9.1. That may very well extend to ElementSecurity. We originally had 9.1.3 U1. That had the problem of intermittently failing to be able to resolve Aliases to their underlying element names. A bit of a problem when you have 200 users using a template that relies on Aliases. We upgraded to 9.1.4 which was supposed to cure both the Alias issue and a SaveData error. It did nothing to cure the Save Data issue. It did lessen though not completely cure the Alias issue. However, the price has been very slow updates to Attributes (All types of Attributes, not just Aliases).

Where possible, I am now deriving Attributes in rules rather than loading them.

Regards


Paul Simon
Post Reply