Session Specific

CalcCache Session Specific

session-specific versus Persistent

Session-specific means calculation results are available for re-use during a session, but are deleted when the application is closed. These results need to be recalculated when a new session is started.

Session-specific is the opposite of persistent. In the GeoDMS persistent means results are also available after closing and reopening an application.

session-specific functions

Some functions result in calculation results are related to the GeoDMS session with which they are calculated. Think for example of the GeoDMSVersion function, a new session with another version of the GeoDMS would result in different results. These functions are called session-specific. Direct or any indirect results of a these functions are always session-specific.

store results persistently

  • session-specific functions

If in a calculation chain a session-specific function is used, the whole tree needs to be recalculated when a new session is started. To avoid this, use an indirect expression with in iif function, see the example:

parameter` version := = (GeoDmsVersion() < 7.120) ? 'oud' : 'nieuw';`

In this example, the GeoDMSVersion function is evaluated when updating the meta information. In the derived expression the session-specific GeoDMSVersion function will not longer occur. The calculation results of the item self and all the derived items can now be stored persistently in the CalcCache.

The direct subitems generated by a composite function, and direct references to these items, are always session-specific. The following example shows a way to still store these results in the CalcCache

attribute ` DistTo (TestGrid) := GridDist(resistance/grid,Test/PointSet/gridnr, const(0, Test/PointSet, impedance));`

attribute` session_specific (TestGrid)d:= DistTo;` `attribute`` persistent       (TestGrid)i:= DistTo + float32(0);`

In this example the [[/attribute]*session_specific*_will_not_be_stored_persistently,_as_the[[expression|attribute] session_specific will not be stored persistently, as the expression is a direct reference to the DistTo attribute, a subitem generated by the griddist function.

The expression of the persistent item adds a value 0 to the session_specific item, resulting in the same calculation results, but in an item that can be stored persistently (of it meets the conditions for storing results in the CalcCache).