JBoss.orgCommunity Documentation
4.1. | What is a cache loader? |
A cache loader is the connection of JBoss Cache to a (persistent) data store. The cache loader is called by JBoss Cache to fetch data from a store when that data is not in the cache, and when modifications are made to data in the cache the Cache Loader is called to store those modifications back to the store. In conjunction with eviction policies, JBoss Cache with a cache loader allows a user to maintain a bounded cache for a large backend datastore. Frequently used data is fetched from the datastore into the cache, and the least used data is evicted, in order to provide fast access to frequently accessed data. This is all configured through XML, and the programmer doesn't have to take care of loading and eviction. JBoss Cache currently ships with several cache loader implementations, including:
| |
4.2. | Is the FileCacheLoader recommended for production use? |
No, it is not. The FileCacheLoader has some severe limitations which restrict it's use in a production environment, or if used in such an environment, it should be used with due care and sufficient understanding of these limitations.
As a rule of thumb, it is recommended that the FileCacheLoader not be used in a highly concurrent, transactional or stressful environment, and it's use is restricted to testing. | |
4.3. | Can writing to cache loaders be asynchronous? |
Yes. Set the
| |
4.4. | Can I write my own cache loader ? |
Yes. A cache loader is a class implementing
| |
4.5. | Does a cache loader have to use a persistent store ? |
No, a cache loader could for example fetch (and possibly store) its data from a webdav-capable webserver. Another example is a caching proxy server, which fetches contents from the web. Note that an implementation of CacheLoader may not implement the 'store' functionality in this case, but just the 'load' functionality. | |
4.6. | Do I have to pay to use Oracle's Berkeley DB CacheLoader? |
Not if you use it only for personal use. As soon as you distribute your product with BdbjeCacheLoader, you have to purchase a commercial license from Oracle. See details at http://www.sleepycat.com/jeforjbosscache . | |
4.7. | Are there any tools available to monitor the Berkeley DB instance? |
Yes. Oracle ships a JMX-based monitoring tool, called JEMonitor which can be downloaded from the Oracle website. | |
4.8. | When tuning my Berkeley DB instance, where should I put my je.properties file? |
| |
4.9. | Can I use more than one cache loader? |
Yes. Within the CacheLoaderConfiguration XML element (see user guide chapter on cache loaders) you can describe several cache loaders. The impact is that the cache will look at all of the cache loaders in the order they've been configured, until it finds a valid, non-null element of data. When performing writes, all cache loaders are written to (except if the ignoreModifications element has been set to true for a specific cache loader. | |
4.10. | Can I migrate a JDBCacheLoader or FileCacheLoader based cache store containing data formatted with JBoss Cache 1.x.x to JBoss Cache 2.0 format? |
Yes. See "Transforming Cache Loaders" section within the "Cache Loaders" section located in the JBoss Cache users guide. | |
4.11. | Is the TCPDelegatingCacheLoader resilient to TCPCacheServer restarts? |
As of JBoss Cache 2.1.0, the answer is yes. See the User Guide for details on how to configure and tune your retries and wait period for reestablishing the TCP connection. Prior to that, restarting the TCPCacheServer would also mean restarting your application that uses the cache. |