TI commits

Post Reply
Moh
Posts: 43
Joined: Fri Aug 01, 2014 5:17 pm
OLAP Product: Cognos
Version: 10.1.1
Excel Version: 2010

TI commits

Post by Moh » Tue Mar 29, 2016 5:22 pm

Good Morning Sir, i am confused when does TI commits in each like tab prolog,metadata ,data,epilog tabs and how is each commit is different.please explain

User avatar
qml
MVP
Posts: 1066
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.5 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: TI commits

Post by qml » Tue Mar 29, 2016 6:53 pm

Generally speaking (although there are some 'instant commit' exceptions) metadata changes made in a process are committed after the Metadata procedure/tab and before the Data procedure/tab. That is why (again, with some specific exceptions) metadata manipulation functions cannot be used on the Data or Epilog tabs, but can be freely used in Prolog or Metadata.

Data changes are more straightforward. All data changes from Prolog, Metadata, Data and Epilog are collected during execution and committed as a single transaction at the very end (after Epilog).

It is also possible to force a data commit during any tab by executing a SaveDataAll which includes its own transaction commit. I would personally call it a hack and certainly would not reccommend using it for this purpose unless you know exactly what you are doing and why.
Kamil Arendt

BrianL
MVP
Posts: 264
Joined: Mon Nov 03, 2014 8:23 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2 PA2
Excel Version: 2016

Re: TI commits

Post by BrianL » Wed Mar 30, 2016 1:42 am

qml wrote:Generally speaking (although there are some 'instant commit' exceptions) metadata changes made in a process are committed after the Metadata procedure/tab and before the Data procedure/tab.
This is not 100% correct. Metadata changes are made available to the rest of the TI process after the metadata procedure/tab but they are not "committed" and made public to the rest of the users. Only the final commit at the end of the transaction actually publishes all changes.

While SaveDataAll does perform a commit and publish all edits previously made, I very strongly recommend against using in the middle of any process or chore. I thought there was some IBM documentation recommending SaveDataAll only be used as the last line of the Epilog tab, but I can't seem to find it right now. One major reason not to do any work after a SaveDataAll is the potential for double commits. Essentially, if the process does some work then calls SaveDataAll and then tries to do some more work but hits lock contention and rolls back, all the work done before the SaveDataAll will be done (and committed) twice. Depending on the specific workload this may just be an annoyance, but if you're using something like CellIncrementN, you would see the cell(s) incremented more than once.

User avatar
Elessar
Regular Participant
Posts: 157
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010
Location: Russia

Re: TI commits

Post by Elessar » Wed Mar 30, 2016 8:00 am

Just a little addition: If you still wanna (despite of Brian's and qml's warnings) use SaveDataAll somewhere outside the end of epilog, it's better to use CubeSaveData.
Sorry for my English ;)

Moh
Posts: 43
Joined: Fri Aug 01, 2014 5:17 pm
OLAP Product: Cognos
Version: 10.1.1
Excel Version: 2010

Re: TI commits

Post by Moh » Wed Mar 30, 2016 1:00 pm

Thank you All,I have one more doubt what will happen when I run the data code that is cellgetN and cellPutN in metadata ,it is adding the data successfully but does this code run in data tab also since it should be there or it just runs in metadata tab and goes to epilog.please explain.

User avatar
qml
MVP
Posts: 1066
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.5 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: TI commits

Post by qml » Wed Mar 30, 2016 2:08 pm

Data changes are fine to do on any tab, as I already said. Obviously, if they rely on metadata changes that are only effected at the end of the Metadata tab then you have no choice but to have them on the Data tab.

If you can avoid having code on both the Metadata tab and the Data tab then the process will run faster as it won't have to loop through the data source twice. It's not always possible to do, but if you only have data changes (e.g. CellPutS) to do then put them all on one tab (either Metadata or Data) and keep the other tab empty.
Kamil Arendt

BrianL
MVP
Posts: 264
Joined: Mon Nov 03, 2014 8:23 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2 PA2
Excel Version: 2016

Re: TI commits

Post by BrianL » Wed Mar 30, 2016 4:02 pm

Elessar wrote:Just a little addition: If you still wanna (despite of Brian's and qml's warnings) use SaveDataAll somewhere outside the end of epilog, it's better to use CubeSaveData.
SaveDataAll will commit and publish all edits previously made as well as saving data to disk and truncating the transaction log. All previous edits now persist and are visible to everyone else. CubeSaveData does not do this. CubeSaveData writes out all data from memory to disk for a single cube. Other objects are not affected and this doesn't change the visibility of any edits to other users or truncate the transaction log.

Moh
Posts: 43
Joined: Fri Aug 01, 2014 5:17 pm
OLAP Product: Cognos
Version: 10.1.1
Excel Version: 2010

Re: TI commits

Post by Moh » Sun Apr 24, 2016 1:35 am

Thanks you QML and all.I understand now.

Post Reply