General

Cache is used to store some database objects in memory/file in order to reduce repetitive queries of database. Currently TOra cache stores following objects:

  • Object names (used to store information about all objects except synonyms)
  • All synonyms for each stored object
  • List of column descriptions for each stored table (in case of packages “columns” represent package functions and procedures)

Implementation

Cache is implemented in class toCache (tocache.cpp/h).

Cache is used for a particular database (storing objects of a particular connection).

If contents of a cache is stored on disk (controlled by a preference) then cache contents is loaded from file when opening a new connection. Contents is saved to disk when opening a connection with nothing yet stored on the disk (or when cache has expired). Cache contents is also saved to disk then closing a connection.

Cache contents is updated dynamically after:

  • querying a list of objects (tables, view etc.) in schema browser
  • querying a list of users

If a users chooses to reread the cache, contents of the cache is cleared and names of objects and their synonyms is re-queried from the database.

Usage

Cache is currently used to:

  • List table/view columns in schema browser constraint (in data tab)
  • Show database user list in all tools
  • Describe object under cursor. Cache is used to check if object exists (in the cache) and if so determine it's type. If object does not exist in the cache, TOra will try to query the database for the objects of the same owner and name, will update the cache (if something new is found) and then continue.
  • Show table/view columns, package functions/procedures in highlighted text
  • Debugger adds program unit being compiled to the cache
  • Security model uses the cache

Configuration

There are following configuration options used:

  • CacheDir - directory used to save caches of all connections
  • CacheDiskUse (default true) - weather cache contents should be stored on disk between TOra sessions.
  • ObjectCache - has following values
    • Start read object cache when needed (0)
    • Read object cache on connect (1)
    • Never read object cache until mandatory (2)
    • Never read object cache (will leave parts of application non-functional (3)
  • CacheTimeout (default 7) - number of days after which cache file becomes outdated (and is not red causing rereading of cache information from the database)
 
knowhow/cache.txt · Last modified: 2010/12/24 09:19 by Tomas Straupis
Recent changes RSS feed Privacy Policy Support This Project