when i want to use jbosscache2.1 for L2 cache.
some problems happed.
my cfg files like:
hibernate.cfg.xml (just a part)
...
<property name="hibernate.cache.use_second_level_cache">
true
</property>
<property name="hibernate.cache.use_query_cache">
true
</property>
<property name="hibernate.cache.region.jbc2.query.localonly">
true
</property>
<property name="hibernate.cache.region.factory_class">
org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory
</property>
...
category.hbm.xml (just a part)
<class name="Category" table="CATEGORY">
<cache usage="transactional"/>
<id name="categoryId" type="java.lang.Long">
<column name="CATEGORYID" precision="22" scale="0" />
<generator class="assigned" />
</id>
...
<map name="props" table="CATEGORYPROP" >
<cache usage="transactional"/>
<key column="CATEGORYID"/>
<index column="NAME" type="java.lang.String" length="100" />
<element column="PROPVALUE" type="java.lang.String" length="4000" not-null="true"/>
</map>
</class>
Exceptions:
1
15:48:42,031 FATAL optimistic-entity:390 - No transaction manager lookup class has been defined. Transactions cannot be used and thus OPTIMISTIC locking cannot be used! Expect errors!!
2
Failed to create local transaction; TransactionManager is null
and some puzzle Exceptions(when no cache conf. ,it's OK!):
3
Could not parse mapping document from resource Category.hbm.xml
4
Duplicate collection role mapping Category.props
the class is like:
public class Category {
private Long categoryId;
private Map<String,String> props = new HashMap<String,String>();
...
//getter/setter
...
}
I had read the doc. for a week,and seach it by google,but i cannot solve it
some one can help me?
thanks!
and could some one give me a demo ?
|