In order to avoid long-running transactions (leading e.g. to issues like
searchObjectsIterativemethod is implemented.
There are three four iteration methods (see
|Fetches objects in single DB transaction. Not supported for all DBMSs. For those that support it (e.g. PostgreSQL) it can lead to long-running transactions spanning hours or even days. Moreover, current transaction isolation settings cause the objects returned to have values that were stored in the database when the search was initiated.|
Uses the "simple paging" method: takes objects (e.g.) numbered 0 to 49, then 50 to 99, then 100 to 149, and so on. The disadvantage is that if the order of objects is changed during operation (e.g. by inserting/deleting some of them) then some objects can be processed multiple times, where others can be skipped.
|Uses the "strictly sequential paging" method: sorting returned objects by OID. This is (almost) reliable in such a way that no object would be skipped. However, custom paging cannot be used in this mode, except for setting |
This is a workaround for situations when
So this method is a safe fallback that is used when
Before midPoint 3.9
Before 3.9, majority of iterations were done in this mode - unless configured otherwise (globally in
config.xml or per individual searches):
Elimination of long-running transactions could lead to a better performance and freshness of data (
means that custom paging cannot be used, except for
maxSizeparameter. In stock midPoint, we typically don't use paging combined with
searchObjectsIterativemethod. But if you have a custom code, e.g. in scripts, make sure you either replace
searchObjects, eliminate the paging (except for
maxSize), or change the default iteration method (see below).
If an iterative search encounters a combination of implicitly-set
and non-compatible custom paging, it:
- If the custom paging has
500(or the current value of
maxObjectsForImplicitFetchAllIterationMethodsystem parameter), then switches iteration method to
- Otherwise it issues an warning message to the log and switches iteration method to
In particular, beware of bulk actions (midPoint scripting). Searching objects there uses