10.2. Query Compilation Cache

The query compilation cache is a Map used to cache parsed query strings. As a result, most queries are only parsed once in Kodo, and cached thereafter. You can control the compilation cache through the kodo.QueryCompilationCache configuration property. This property accepts a plugin string (see Section 2.5, “Plugin Configuration”) describing the Map used to associate query strings and their parsed form. This property accepts the following aliases:

Table 10.2. Pre-defined aliases

AliasValueNotes
true kodo.util.CacheMap The default option. Uses a CacheMap to store compilation data. CacheMap uses a least-recently-used strategy for a fixed number of cache entries, and an optional soft reference map for entries that are moved out of the LRU space. So, for applications that have a monotonically increasing number of distinct queries, this option can be used to ensure that a fixed amount of memory is used by the cache.
all java.util.HashMap This is the fastest option, but compilation data is never dropped from the cache, so if you use a large number of dynamic queries, this option may result in ever-increasing memory usage. Note that if your queries only differ in the values of the parameters, this should not be an issue.
falsenone Disables the compilation cache.