Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Iterating over all sessions in storage does not take any locks. This means that if a workflow updates the storage at the same time as the iteration is ongoing, sessions can be missed in the search or the same sessions can be returned twice. There is an "Error Count" on the iterator that can be used when this type of inconsistency has been detected. This is the same as the type of inconsistencies that can be detected in the Aggregation Session Inspector where sessions are not accessible.

sessionIteratorCreate

Creates a new iterator that can be used in the other three functions.

Code Block
any sessionIteratorCreate( string profileName )

sessionIteratorNext

Returns the next session or null if the full session storage has been traversed.

Code Block
drudr sessionIteratorNext( any iterator )

sessionIteratorErrorCount

Returns the number of detected errors during the iteration. This is a fairly normal condition when the storage is updated or removed while the iteration is ongoing. Each error will typically mean that one session was missed, but it can also mean a larger number of missed sessions if the storage was moved.

...

Code Block
int sessionIteratorErrorCount( any iterator )

sessionIteratorDestroy

Destroy the iterator to release resources to avoid a memory leak due to iterators being left in live state. This is not needed if the iteration is run to the end.

Code Block
void sessionIteratorDestroy( any iterator )

Best practice to implement sessionIterators in APL

An example below of searching for a session that matches an "intField" value.
"QueryData" is here the session type of the "Default.queryagg" profile.

...