org.objectweb.cjdbc.controller.cache
Class CachingGranularities

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.cache.CachingGranularities

public class CachingGranularities
extends java.lang.Object

This class defines request cache granularities.

Version:
1.0
Author:
Emmanuel Cecchet, Nicolas Modrzyk

Field Summary
static int COLUMN
          Column granularity: entries in the cache are invalidated based on column dependencies.
static int COLUMN_UNIQUE
          Column granularity with UNIQUE queries: same as COLUMN except that UNIQUE queries that selects a single row based on a key are not invalidated on INSERTs.
static int COLUMN_UNIQUE_DELETE
          Column granularity with UNIQUE queries and UNIQUE_DELETE optimization.
static int COLUMN_UNIQUE_INSERT_DB
          Column granularity with UNIQUE queries and INSERT_DB optimization: same as COLUMN_UNIQUE except that queries are not invalidated on an INSERT, they are just marked dirty.
static int COLUMN_UNIQUE_INSERT_DB_UNIQUE_UPDATE
          Column granularity with UNIQUE queries, INSERT_DB and UNIQUE_UPDATE optimizations: same as COLUMN_UNIQUE_INSERT_DB except that queries are not invalidated on an UPDATE if the update statement affects a UNIQUE row.
static int DATABASE
          Database granularity: entries in the cache are invalidated every time a write (INSERT/UPDATE/DELETE/DROP/...) is sent to the database.
static int NO_INVALIDATE
          Cache without any invalidation: the cache is inconsistent and it should just be used to determine hit ratio upper bound.
static int TABLE
          Table granularity: entries in the cache are invalidated based on table dependencies.
 
Constructor Summary
CachingGranularities()
           
 
Method Summary
static java.lang.String getGranularityName(int cacheGrain)
          Gets the name corresponding to a cache granularity level.
static java.lang.String getGranularityXml(int cacheGrain)
          This method is needed to convert the value into the corresponding xml attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_INVALIDATE

public static final int NO_INVALIDATE
Cache without any invalidation: the cache is inconsistent and it should just be used to determine hit ratio upper bound.

See Also:
Constant Field Values

DATABASE

public static final int DATABASE
Database granularity: entries in the cache are invalidated every time a write (INSERT/UPDATE/DELETE/DROP/...) is sent to the database.

See Also:
Constant Field Values

TABLE

public static final int TABLE
Table granularity: entries in the cache are invalidated based on table dependencies.

See Also:
Constant Field Values

COLUMN

public static final int COLUMN
Column granularity: entries in the cache are invalidated based on column dependencies.

See Also:
Constant Field Values

COLUMN_UNIQUE

public static final int COLUMN_UNIQUE
Column granularity with UNIQUE queries: same as COLUMN except that UNIQUE queries that selects a single row based on a key are not invalidated on INSERTs.

See Also:
Constant Field Values

COLUMN_UNIQUE_INSERT_DB

public static final int COLUMN_UNIQUE_INSERT_DB
Column granularity with UNIQUE queries and INSERT_DB optimization: same as COLUMN_UNIQUE except that queries are not invalidated on an INSERT, they are just marked dirty. When a dirty entry is found, the INSERT_DB is used to determine if the result is still valid or not.

See Also:
Constant Field Values

COLUMN_UNIQUE_INSERT_DB_UNIQUE_UPDATE

public static final int COLUMN_UNIQUE_INSERT_DB_UNIQUE_UPDATE
Column granularity with UNIQUE queries, INSERT_DB and UNIQUE_UPDATE optimizations: same as COLUMN_UNIQUE_INSERT_DB except that queries are not invalidated on an UPDATE if the update statement affects a UNIQUE row. In this case, affected cache entries are just marked dirty. When a dirty entry is found, the UPDATE_DB is used to determine if the result is still valid or not.

See Also:
Constant Field Values

COLUMN_UNIQUE_DELETE

public static final int COLUMN_UNIQUE_DELETE
Column granularity with UNIQUE queries and UNIQUE_DELETE optimization.

Here, in case of a DELETE request:

Same as COLUMN_UNIQUE except that a DELETE only invalidates queries that result in the same single row as the DELETE.

See Also:
Constant Field Values
Constructor Detail

CachingGranularities

public CachingGranularities()
Method Detail

getGranularityName

public static final java.lang.String getGranularityName(int cacheGrain)
Gets the name corresponding to a cache granularity level.

Parameters:
cacheGrain - cache granularity level
Returns:
the name of the granularity level

getGranularityXml

public static final java.lang.String getGranularityXml(int cacheGrain)
This method is needed to convert the value into the corresponding xml attribute value. If fails, returns noInvalidation granularity value so the xml retrieved can be used.

Parameters:
cacheGrain - cache granularity level
Returns:
the xml attribute value of the granularity level


Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.