We're updating the issue view to help you get more done. 

Hibernate/Infinispan 2nd Level Caches set to JBoss7 transaction-mode=NONE stop functioning after an explicit eviction

Description

The caches in the 'infinispan' subsystem configured with <transaction mode="NONE"/> (which results in no transaction used by 2LC) get stuck in state= CLEARING when you perform a programmatic evict() on them to clear the caches. (Using e.g. em.getEntityManagerFactory().getCache().evictAll() )
The problem seem to lie within the class 'org.hibernate.cache.infinispan.impl.BaseRegion, where the 'checkValid' method fails to clear the cache (and set back the state to VALID). The reason it fails is due to that it calls: cacheAdapter.withinTx() , which in turn tries to get the TransactionManager from the cache (which seems to be null for these non-transactional caches), and then NPEs on the tm.begin(); The NPE is caught and logs out (TRACE in org.hibernate.cache.infinispan.impl.BaseRegion) "Could not invalidate region: null", and never set the state in VALID. So from thereon the caches are in an Invalid state and is not used anymore by Infinispan, thus leading to much performance.

Environment

JBoss 7.1.3 with hibernate version 4.1.6. Have also today (12-01-30) tried with the latest JBoss7 nightly plus the latest hibernate 4.1.9 - same problem.

Status

Assignee

Brett Meyer

Reporter

Fredrik Lagerblad

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

4.1.9

Priority

Major