[infinispan-issues] [JBoss JIRA] (ISPN-5854) NonTxInvalidationInterceptor added twice to cache used for Hibernate 2LC
Karl von Randow (JIRA)
issues at jboss.org
Wed Nov 11 21:03:00 EST 2015
[ https://issues.jboss.org/browse/ISPN-5854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128006#comment-13128006 ]
Karl von Randow commented on ISPN-5854:
---------------------------------------
Thank you for your steer. I've only just come back to attempting Hibernate 5. You are of course correct about how entity regions are configured, and we didn't have a problem there as it turns out. I have multiple entities configured with the same cache region, and configuration in the form of `hibernate.cache.infinispan.REGION.eviction.max_entries` etc that uses the `entities` template and makes changes to it.
It appears to be related to collection regions. While a single entity region is supported, and the access strategy is reused, the same is not true (it appears) for collections. You're correct, this appears to be a Hibernate bug and I shall raise it there.
Thank you very much for your useful, and speedy response.
Best,
Karl
> NonTxInvalidationInterceptor added twice to cache used for Hibernate 2LC
> ------------------------------------------------------------------------
>
> Key: ISPN-5854
> URL: https://issues.jboss.org/browse/ISPN-5854
> Project: Infinispan
> Issue Type: Bug
> Components: Integration
> Affects Versions: 7.2.5.Final
> Reporter: Karl von Randow
> Assignee: Galder Zamarreño
>
> I use the same Infinispan cache for multiple Hibernate entities. The {{PutFromLoadValidator}} looks for and replaces the {{InvalidationInterceptor}} the first time it sees the cache, but the second time it fails to find the {{InvalidationInterceptor}} and ends up with {{invalidationPosition = 0}} from line 168, which means it incorrectly removes the first interceptor from the chain and then tries to add the {{NonTxInvalidationInterceptor}} again, causing the exception below.
> Perhaps the {{NonTxInvalidationInterceptor}} should only be added once per cache, or the {{accessStrategy}} should be cached or something?
> {noformat}
> org.infinispan.commons.CacheConfigurationException: Detected interceptor of type [org.hibernate.cache.infinispan.access.NonTxInvalidationInterceptor] being added to the interceptor chain 170588969 more than once!
> at org.infinispan.interceptors.InterceptorChain.assertNotAdded(InterceptorChain.java:76)
> at org.infinispan.interceptors.InterceptorChain.addInterceptor(InterceptorChain.java:90)
> at org.infinispan.cache.impl.CacheImpl.addInterceptor(CacheImpl.java:883)
> at org.hibernate.cache.infinispan.access.PutFromLoadValidator.<init>(PutFromLoadValidator.java:192)
> at org.hibernate.cache.infinispan.access.PutFromLoadValidator.<init>(PutFromLoadValidator.java:133)
> at org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion.prepareForValidation(BaseTransactionalDataRegion.java:137)
> at org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion.createAccessDelegate(BaseTransactionalDataRegion.java:122)
> at org.hibernate.cache.infinispan.collection.CollectionRegionImpl.buildAccessStrategy(CollectionRegionImpl.java:49)
> at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:400)
> at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
> at org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:170)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the infinispan-issues
mailing list