Infinispan as a L2C
thammoud Apr 20, 2011 8:44 AMHello,
Using JBOSS 61 on Linux.
Below is our persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="FinancialDataServer">
<jta-data-source>java:/FinancialDataServerDS</jta-data-source>
<properties>
<property name="jboss.entity.manager.jndi.name" value="java:/FinancialDataServerManager"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/FinancialDataServerManagerFactory"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.InfinispanRegionFactory"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.infinispan.cachemanager" value="java:CacheManager"/>
</properties>
</persistence-unit>
</persistence>
In deploy/cluster/infinispan-cache-registry.sar/infinispan-configs.xml, I changed "entity", "local-query" to never evict with the following:
<eviction wakeUpInterval="0" strategy="NONE"/>
Running our code the first time, yields the expected behavior (i.e SQL). Running it again right away, also yields the expected results. i.e Everything from the cache confirmed from the hibernate logging. After a while a couple of minutes or so, the logging from hibernate claims not to find the results and fires SQL clearly not what we expect. It looks like the items are being evicted (nothing from the infinispan log) and we are not doing any writes to force the evictions. Any ideas on why it hit some cache first and none later?
One thing I did notice (that I thought was strange) in the JMX console is the CacheManager status was "INSTANTIATED" and not "STARTED". Also the "DefinedCacheNames" had none of the caches "created".
Thanks for your help.