Class JDBCDiskCache<K,V>

All Implemented Interfaces:
AuxiliaryCache<K,V>, ICache<K,V>, ICacheType
Direct Known Subclasses:
MySQLDiskCache

public class JDBCDiskCache<K,V> extends AbstractDiskCache<K,V>
This is the jdbc disk cache plugin.

It expects a table created by the following script. The table name is configurable.

                       drop TABLE JCS_STORE;
                       CREATE TABLE JCS_STORE
                       (
                       CACHE_KEY                  VARCHAR(250)          NOT NULL,
                       REGION                     VARCHAR(250)          NOT NULL,
                       ELEMENT                    BLOB,
                       CREATE_TIME                TIMESTAMP,
                       UPDATE_TIME_SECONDS        BIGINT,
                       MAX_LIFE_SECONDS           BIGINT,
                       SYSTEM_EXPIRE_TIME_SECONDS BIGINT,
                       IS_ETERNAL                 CHAR(1),
                       PRIMARY KEY (CACHE_KEY, REGION)
                       );
 

The cleanup thread will delete non eternal items where (now - create time) > max life seconds * 1000

To speed up the deletion the SYSTEM_EXPIRE_TIME_SECONDS is used instead. It is recommended that an index be created on this column is you will have over a million records.