John Hammond wrote:
Yes as you say there is the consideration as to date last updated = time written to disk or to memory.
You could write a wrapper around savedataall to ensure the last write to disk was known
Only if you assume that nobody will ever trigger a save from the GUI. Otherwise David's initial statement remains correct; the date of the .cub file on disk is the sole way of accurately determining this.
John Hammond wrote:but wrapping up cellputn for last write to memory would be a collosal performance overhead in TM1.
Again, this would presuppose that not a single update is ever done by anything other than TI.
John Hammond wrote:Or savedataall last done = timestamp of latest log if I am not mistaken so we can do something for the TM1 server but not individual cubes.
More or less correct, bearing in mind that the timestamp contained in the file name (as opposed to the date and time of the file itself) is in UTC rather than local time.
I suspect that cubes which have "dirty" data are flagged
in memory for saving the next time a data save / server shutdown is done. It would certainly be safer than relying on a value stored in a cube, which could be accidentally overwritten by an Admin. However I can't find a property which would allow you to read that flag, or even whether the flag takes the format of a date / time stamp or just a straight out Boolean value.
In the API you can access an object property called TM1ObjectLastTimeUpdated, but when I looked at a list of cubes generated from my own code I noticed something curious about that property.
The property for most of the cubes on my server was the time of reboot in the early hours of this morning. The time for my process control cube was the time of the previous chore execution. Yet the property for the cube that was
updated by that chore was... the server boot time.
Apparently the TM1ObjectLastTimeUpdated property is only updated when there are
logged changes in the cube. When logging is turned off, the time updated property is not updated. (In the case of the chore mentioned above logging was off on the data cube (which showed no change to the property's value), but on on the process control cube (for which the update property
was changed).) Accordingly it's safe to conclude that:
(a) That property is not the one that triggers a save of a particular cube; and
(b) It also can't be used for determining when the last change was made to the cube if the change was not logged.
I'll take a poke around some of the other properties when I have time but it's not looking promising.
Of course, it does raise the question of why you actually
need this information, and consequently whether there might be a more practical alternative that could be employed.