[jboss-user] [JBoss Cache: Core Edition] - Re: <cache-configs/> or <jbosscache> format?
do-not-reply at jboss.com
Sat Feb 14 22:19:56 EST 2009
Yes, the early format was deprecated in JBC 3, although it should still work fine.
The schema shown on p 105 of the 3.0.2.GA userguide is for a single config, while the old "cache-configs" format was used when you wanted to specify several named configs in a single document, which is what org.hibernate.cache.jbc2.JBossCacheRegionFactory expects. But, JBC3 has a new schema to handle that too, although I'm not sure if it's covered in the docs. Here's an example:
| <?xml version="1.0" encoding="UTF-8"?>
| <registry:cache-configs xmlns="urn:jboss:jbosscache-core:config:3.0" xmlns:registry="urn:jboss:jbosscache-core:cache-repo:3.0">
| Various JBoss Cache configurations, suitable for different caching
| uses (e.g. entities vs. queries).
| In all cases, TransactionManager configuration not required.
| Hibernate will plug in its own transaction manager integration.
| <!-- A config appropriate for entity/collection caching. -->
| <registry:cache-config name="optimistic-entity">
| <locking lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
| <!-- A config appropriate for entity/collection caching that
| uses pessimistic locking -->
| <registry:cache-config name="pessimistic-entity">
| <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="pessimistic"/>
The content of a "registry:cache-config" element is the same as the content of a "jbosscache" element shown in the user guide. Only difference is the "registry:cache-config" element must have a "name" attribute where you give a name to the config, same as the JBC 2 "cache-config" element's "name" attribute.
If you are using JBC3, I'm quite certain JBossCacheRegionFactory will handle the JBC3 schema without problems, since it delegates the parsing to JBC3 code.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4210167#4210167
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4210167
More information about the jboss-user