Infinispan - set per Entity expiration.lifespan

前端 未结 2 568
醉话见心
醉话见心 2021-01-14 08:51

I have a java web application deployed on Jboss 6.1.0, that uses infinispan 5.2.6.Final. I\'m trying to set a per Entity specific expiration.lifespan follow

相关标签:
2条回答
  • 2021-01-14 09:03

    If you are running within the application server, apart from the entity name, you have to provide the deployment name and unit too. So, all such expiration properties need to be prepended with: hibernate.cache.infinispan.<warname>.<unitname>.<FQN of entity>...

    In your case, I don't know the name of your deployment, but with the unit and FQN that you mention, something like:

    hibernate.cache.infinispan.<warname>.myProject_dal_PU.com.myenterprise.myproject.dal.ejb.entity.RefStatus.expiration.lifespan

    0 讨论(0)
  • 2021-01-14 09:17

    Spent hours to find correct configuration. Apparently it is as following:

    Hibernate property should be in the following format:

    hibernate.cache.infinispan.<prefix>.<full-class-name>.<property-name> where:

    <prefix> - by default it is in the name that you see in a sort of JNDI name. In case of Wildfly, it is ear-name.ear/ejb-jar-name.jar#persistence-unit-name However, it can be controlled by hibernate.cache.region_prefix property. Set region_prefix to "" and ignore the prefix.

    <property-name> - String as it appears in org.hibernate.cache.infinispan.InfinispanRegionFactory class and in official Infinispan documentation.

    In short, official Infinispan documentation is correct only when you set hibernate.cache.region_prefix to ""

    0 讨论(0)
提交回复
热议问题