Author: tv Date: Mon Nov 23 15:51:42 2015 New Revision: 1715856 URL: http://svn.apache.org/viewvc?rev=1715856&view=rev Log: Replace PoolAccess with a DataSourceFactory model borrowed from DB-Torque Add docs.
Modified: commons/proper/jcs/trunk/xdocs/JDBCDiskCache.xml commons/proper/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml Modified: commons/proper/jcs/trunk/xdocs/JDBCDiskCache.xml URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/xdocs/JDBCDiskCache.xml?rev=1715856&r1=1715855&r2=1715856&view=diff ============================================================================== --- commons/proper/jcs/trunk/xdocs/JDBCDiskCache.xml (original) +++ commons/proper/jcs/trunk/xdocs/JDBCDiskCache.xml Mon Nov 23 15:51:42 2015 @@ -90,7 +90,7 @@ thread_pool.disk_cache_event_queue.start <subsection name="Example #2 cache.ccf (MySQL)"> <p> - This example uses two JDBC Disck Cache instances and a shared connection pool. + This example uses two JDBC Disk Cache instances and a shared connection pool. </p> <source> <![CDATA[ @@ -161,6 +161,77 @@ thread_pool.disk_cache_event_queue.start ]]> </source> </subsection> + + <subsection name="Example #3 cache.ccf (JNDI)"> + <p> + This example uses the two JDBC Disk Cache instances from the example above and a JNDI data source. + </p> + <source> + <![CDATA[ +jcs.default=JDBC_0 +jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes +jcs.default.cacheattributes.MaxObjects=100 +jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache +jcs.default.cacheattributes.UseMemoryShrinker=false +jcs.default.cacheattributes.MaxMemoryIdleTime=3600 +jcs.default.cacheattributes.ShrinkerInterval=60 +jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes +jcs.default.elementattributes.IsEternal=false +jcs.default.elementattributes.MaxLife=700 +jcs.default.elementattributes.IdleTime=1800 +jcs.default.elementattributes.IsSpool=true +jcs.default.elementattributes.IsRemote=true +jcs.default.elementattributes.IsLateral=true + +# ############################################################# +# ################# CONFIGURED REGIONS ######################## + +jcs.region.testCache1=JDBC_1 +jcs.region.testCache1.cacheattributes.MaxObjects=10000 + +# ############################################################# +# ################# AUXILIARY CACHES AVAILABLE ################ +# JDBC disk cache +jcs.auxiliary.JDBC_0=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory +jcs.auxiliary.JDBC_0.attributes=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes +jcs.auxiliary.JDBC_0.attributes.tableName=JCS_STORE_0 +jcs.auxiliary.JDBC_0.attributes.testBeforeInsert=false +jcs.auxiliary.JDBC_0.attributes.allowRemoveAll=true +jcs.auxiliary.JDBC_0.attributes.MaxPurgatorySize=10000000 +jcs.auxiliary.JDBC_0.attributes.connectionPoolName=JNDI +jcs.auxiliary.JDBC_0.attributes.EventQueueType=POOLED +jcs.auxiliary.JDBC_0.attributes.EventQueuePoolName=disk_cache_event_queue + +jcs.auxiliary.JDBC_1=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory +jcs.auxiliary.JDBC_1.attributes=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes +jcs.auxiliary.JDBC_1.attributes.tableName=JCS_STORE_1 +jcs.auxiliary.JDBC_1.attributes.testBeforeInsert=false +jcs.auxiliary.JDBC_1.attributes.allowRemoveAll=true +jcs.auxiliary.JDBC_1.attributes.MaxPurgatorySize=10000000 +jcs.auxiliary.JDBC_1.attributes.connectionPoolName=JNDI +jcs.auxiliary.JDBC_1.attributes.EventQueueType=POOLED +jcs.auxiliary.JDBC_1.attributes.EventQueuePoolName=disk_cache_event_queue + +# ############################################################# +# ######## OPTIONAL JNDI CONNECTION POOL CONFIGURATION ###### +# JNDI Pool + +jcs.jdbcconnectionpool.JNDI.attributes.jndiPath=java:comp/env/jdbc/MyDB +jcs.jdbcconnectionpool.JNDI.attributes.jndiTTL=300000 + +# ############################################################# +# ################# OPTIONAL THREAD POOL CONFIGURATION ######### +# Disk Cache pool +thread_pool.disk_cache_event_queue.useBoundary=false +thread_pool.disk_cache_event_queue.boundarySize=500 +thread_pool.disk_cache_event_queue.maximumPoolSize=15 +thread_pool.disk_cache_event_queue.minimumPoolSize=10 +thread_pool.disk_cache_event_queue.keepAliveTime=3500 +thread_pool.disk_cache_event_queue.whenBlockedPolicy=RUN +thread_pool.disk_cache_event_queue.startUpSize=10 + ]]> + </source> + </subsection> <subsection name="Table Creation Script (MySQL)"> <source> Modified: commons/proper/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml?rev=1715856&r1=1715855&r2=1715856&view=diff ============================================================================== --- commons/proper/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml (original) +++ commons/proper/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml Mon Nov 23 15:51:42 2015 @@ -57,14 +57,14 @@ added to this value to create the full database url. </td> - <td>Y</td> + <td>N</td> <td></td> </tr> <tr> <td>database</td> <td>This is appended to the url.</td> - <td>Y</td> + <td>N</td> <td></td> </tr> @@ -74,10 +74,42 @@ The class name of the driver to talk to your database. </td> - <td>Y</td> + <td>N</td> <td></td> </tr> + <tr> + <td>userName</td> + <td>The database user name.</td> + <td>N</td> + <td></td> + </tr> + + <tr> + <td>password</td> + <td>The database user password.</td> + <td>N</td> + <td></td> + </tr> + + <tr> + <td>jndiPath</td> + <td> + The JNDI lookup path in the form <code>java:comp/env/jdbc/MyDB</code>. + This entry is preferred over the set of <code>url</code>, <code>driverClassName</code>, + <code>userName</code> and <code>password</code>. + </td> + <td>N</td> + <td></td> + </tr> + + <tr> + <td>jndiTTL</td> + <td>The time between two JNDI lookups in ms.</td> + <td>N</td> + <td>0</td> + </tr> + <tr> <td>tableName</td> <td>The name of the table.</td> @@ -131,7 +163,7 @@ <tr> <td>ShrinkerInterval</td> - <td>How often should the disk shrinker run.</td> + <td>How often should the disk shrinker run (in seconds).</td> <td>N</td> <td>300</td> </tr>