Page 1 of 1

TM1 API Element Security

Posted: Tue Oct 21, 2008 9:41 am
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

Re: TM1 API Element Security

Posted: Wed Oct 22, 2008 2:46 pm
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

Re: TM1 API Element Security

Posted: Fri Jan 30, 2009 7:13 am
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

Re: TM1 API Element Security

Posted: Fri Jan 30, 2009 9:14 am
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 :)

Re: TM1 API Element Security

Posted: Tue Feb 03, 2009 11:52 pm
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