Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.1
Hi,
I am trying to configure the ehcache with our weblogic cluster and have downloaded the recent version also of ehcache jar 1.2.2 from ehcache site.
Problem:
As given in hibernate docs, that hibernate creates caches named after the fully qualified name of Domain Objects. So I created one entry in my ehcache.xml file like this:
Code:
<cache name="com.hp.dspp.common.pojo.DsppPartnerTaxonomy"
maxElementsInMemory="1000"
eternal="false"
timeToLiveSeconds="2000"
overflowToDisk="false"
/>
Here is my code to execute the query and want to cache the query result sets:
Code:
final Query query = session.createQuery(
"select master.TaxonomyId,detail.Name from DsppPartnerTaxonomy master join master.SetOfDsppPartnerTaxonomyDetail detail");
query.setCacheable(true);
query.setCacheRegion("com.hp.dspp.common.pojo.DsppPartnerTaxonomy");
return query.list();
The above code is perfectly fine and working but If i want to use cache region names as simple instead of fully qualified domain names, like
DsppPartnerTaxonomy, its not executing the query and throwing error. I want to remove that
com.hp.dspp.common.pojo from cache region name.
This is not my personal choice that I want to remove, its a requirement, because if i am using FQDN, then cluster configuration of ehcache is giving problem. In cluster configuration of ehcache, we have to write the following tag in each of the server ehcache.xml file:
Code:
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//server2:40001/sampleCache11|//server2:40001/sampleCache12"/>
If you notice, in the above tag we have to give our cache name in place of
sampleCache11. E.g. here as per my code it should be
com.hp.dspp.common.pojo.DsppPartnerTaxonomy, but this FQDN notation of cache name is not working here for cluster configuration.
Please help, how should I proceed here. Any pointers are welcome. Please!!! help.