I'm trying to switch from ehcache which seems to be working well to 'native' Wildfly's Infinispan. I did not made any change to default configuration of WildFly and I'm using hibernate and infinispan built-in modules. I started with basic persistence configuration like:
<persistence-unit name="frmwrkjta" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/ds/frmwrkmysqljta</jta-data-source>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode><!-- ALL, NONE, ENABLE_SELECTIVE,DISABLE_SELECTIVE, UNSPECIFIED -->
<properties>
<property name="shared-cache-mode" value="ENABLE_SELECTIVE" />
<!-- <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/> -->
<property name="net.sf.ehcache.configurationResourceName" value="META-INF/ehcache-persistence.xml" />
<property name="hibernate.cache.use_query_cache" value="true" />
<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.generate_statistics" value="true" />
<property name="hibernate.cache.infinispan.statistics" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
<!-- <property name="hibernate.hbm2ddl.auto" value="update" /> -->
<property name="hibernate.hbm2ddl.auto" value="validate" />
<property name="hibernate.show_sql" value="true" />
<property name="org.hibernate.envers.audit_table_suffix" value="_log" />
<property name="org.hibernate.envers.revision_field_name" value="dbrevision_r" />
<property name="org.hibernate.envers.revision_type_field_name" value="dbrevtype" />
</properties>
</persistence-unit>
Later on I was trying to add properties googled...
This first one was my favorit:
<property name="hibernate.cache.default_cache_concurrency_strategy" value="read-only"/>
afterwards also using all optional values like transactional
, read-only
, nontrict read-write
, even read-write
;)
then:
<property name="hibernate.cache.infinispan.container" value="hibernate"/>
later:
<property name="hibernate.cache.region.factory_class" value="org.jboss.as.jpa.hibernate4.infinispan.SharedInfinispanRegionFactory" />
All this finished with failed deployment exception:
org.hibernate.cache.CacheException: Unsupported access type [read-write]
I am using only JPA's @Cacheable
annotation in entities...
What am I missing, what am I doing wrong?
EDIT:
Not sure if it matters. I'm adding omitted start of persistence.xml... I'm trying to use JPA2.1:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" version="2.1">