Database Reference
In-Depth Information
In addition, note that unhandled exceptions aren't stored in the result cache. In other words, if a function raises
an exception and the exception is propagated to the caller, the next call of the same function will be executed again.
Client Result Cache
The client result cache is a client-side cache that stores the result sets of queries executed by applications using
Oracle Database drivers built on top of OCI libraries (for example JDBC OCI, ODP.NET, OCCI, and ODBC). Its purpose
and workings are similar to the server result cache. In particular, the available techniques to enable the cache
(the result_cache hint, the RESULT_CACHE clause, and the result_cache_mode initialization parameter) are the same.
The only additional requirement is that exclusively SQL statements that take advantage of client-side statement
caching (refer to Chapter 12) can use the client result cache. Compared to server-side implementation, there are
two important differences. First, it avoids the client/server round-trips needed to execute SQL statements. This is
a big advantage. Second, the invalidations are based on a polling mechanism, and therefore, consistency can't be
guaranteed. This is a big disadvantage.
Note
In a 12.1 multitenant environment, the client result cache isn't supported.
To implement polling, a client has to regularly execute database calls to check with the database engine whether
one of its cached result sets has to be invalidated. To minimize the overhead associated with polling, every time a
client executes a database call for another reason, it checks the validity of the cached result sets as well. In this way,
database calls that are used exclusively for the invalidation of the cached result sets are avoided for clients that are
steadily executing “regular” database calls.
Even if this is a client-side cache, you have to enable it on the server side. Note that the client-side cache also
works if the server-side cache is disabled (in other words, if the result_cache_max_size initialization parameter is set
to 0). The following are the initialization parameters that control the client result cache:
client_result_cache_size specifies (in bytes) the maximum amount of memory that every
client process can use for the result cache. If it's set to 0, which is the default, the feature
is disabled. This initialization parameter is static and can be set only at the system level. A
database instance bounce is therefore necessary to change it.
client_result_cache_lag specifies (in milliseconds) the maximum time lag between two
database calls. In other words, it specifies how long stale result sets can remain in the
client-side cache. The default value is 3,000. This initialization parameter is static and can be
set only at the system level. A database instance bounce is therefore necessary to change it.
In addition to the server-side configuration, the following parameters can be specified in the client's
sqlnet.ora file:
oci_result_cache_max_size overrides the server-side setting that is specified with the
client_result_cache_size initialization parameter. Note, however, that if the client result
cache is disabled on the server side, this parameter can't enable it.
oci_result_cache_max_rset_size specifies (in bytes) the maximum amount of memory any
single result set can use.
oci_result_cache_max_rset_rows specifies the maximum number of rows any single result
set can store.
 
 
Search WWH ::




Custom Search