Page 1 of 1

TI commits

Posted: Tue Mar 29, 2016 5:22 pm
by Moh
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

Re: TI commits

Posted: Tue Mar 29, 2016 6:53 pm
by qml
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.

Re: TI commits

Posted: Wed Mar 30, 2016 1:42 am
by BrianL
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.

Re: TI commits

Posted: Wed Mar 30, 2016 8:00 am
by Elessar
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.

Re: TI commits

Posted: Wed Mar 30, 2016 1:00 pm
by Moh
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.

Re: TI commits

Posted: Wed Mar 30, 2016 2:08 pm
by qml
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.

Re: TI commits

Posted: Wed Mar 30, 2016 4:02 pm
by BrianL
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.

Re: TI commits

Posted: Sun Apr 24, 2016 1:35 am
by Moh
Thanks you QML and all.I understand now.