分类:
2010-05-14 08:38:02
The latest version of open source caching framework supports write-behind caching and transaction management using Java Transaction API (). It also includes a Hibernate 3.3 caching plugin, Bulk Loading API for clustered caches, and runtime cache reconfiguration.
Ehcache 2.0 introduces write-through and write-behind caching. Write-through caching pattern is used by the applications to write data to the cache which causes writes to an underlying resource (e.g. a database). The cache acts as a facade to the underlying resource. Write-behind caching pattern uses the same client API, but the write happens asynchronously. The write-behind cachingfeature, supported as part of the new Ehcache API, works with asynchronous batching of updates to the database.
Transaction Management: The new JTA support enables the cache to participate as an XA resource in JTA transactions. It automatically detects and uses the following transaction managers in the order: Generic JNDI (e.g.Glassfish, , Weblogic, ), , JTA Transaction Manager, and . Ehcache 2.0 is not a "transactional" cache for Hibernate purposes. Ehcache 2.1 (beta version was recently released) provides the JTA support for Hibernate.
Ehcache 2.0 also includes an express mode that be used to cluster the application data via configuration changes, whether the data is in Hibernate, a distributed cache, or session objects. It supports distributed caching as a Hibernate second-level cache, as well as directly through the . Switching between local and distributed implementations is done with a configuration change. Other features in the new version include:
Ehcache 2.0 includes support for Java EE containers like WebLogic, , JBoss, and . In a related news item, Ehcache team also released theEhcache Server which provides RESTful and SOAP APIs to Ehcache framework.