Thank you Shand1216 for replying!
I enabled the debug, but I did not see "Cache new" or "Cache hit", here are the messages that was showed:
--------------------------------------------------------------------
11:48:08,858 DEBUG ReadWriteCache:24 - Cache lookup: com.hibernate.AliasKey@6ea0649b
11:48:08,928 DEBUG ReadWriteCache:37 - Cache miss: com.hibernate.AliasKey@6ea0649b
11:48:09,048 DEBUG ReadWriteCache:56 - Caching: com.hibernate.AliasKey@6ea0649b
11:48:09,078 DEBUG ReadWriteCache:65 - Cached: com.hibernate.AliasKey@6ea0649b
11:48:09,088 DEBUG ReadWriteCache:24 - Cache lookup: com.hibernate.AliasKey@b15593fa
11:48:09,108 DEBUG ReadWriteCache:37 - Cache miss: com.hibernate.AliasKey@b15593fa
11:48:09,188 DEBUG ReadWriteCache:56 - Caching: com.hibernate.AliasKey@b15593fa
11:48:09,209 DEBUG ReadWriteCache:65 - Cached: com.hibernate.AliasKey@b15593fa
----------------------------------------------------------------------
And also in my cache.ccf, I use
jcs.default=DC
jcs.region.com.hibernate.Alias=DC
it will show me that:
-------------------------------------------------------------------------
11:48:03,240 WARN OptionConverter:135 - Could not find value for key jcs.auxiliary.DC
11:48:03,240 ERROR CompositeCacheConfigurator:359 - Could not instantiate auxFactory named "DC".
--------------------------------------------------------------------------
Do you know what I need to change?
Here is my .hbm.xml file
*****************************************************
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.hibernate.Alias" table="alias">
<jcs-cache usage="read-write"/>
<composite-id name="id">
<key-property name="firm" column="firm"/>
<key-property name="userid" column="userid"/>
<key-property name="alias" column="alias"/>
</composite-id>
<property name="sub_client" column="sub_client"/>
<property name="update_ident" column="update_ident"/>
</class>
</hibernate-mapping>
<!-- parsed in 10ms -->
**********************************************************
Here is the code I load the object:
**********************************************************
public void listAlias() throws HibernateException
{
Session session = sessionFactory.openSession();
Iterator iter = session.iterate("from com.hibernate.Alias as alias");
while (iter.hasNext())
{
Alias myAlias = (Alias) iter.next();
System.out.println("-------client is----" + myAlias.getClient());
System.out.println("-------subclient is----" + myAlias.getSub_client());
session.evict(myAlias);
}
session.close();
}
**********************************************************
Thanks for helping!
|