[infinispan-issues] [JBoss JIRA] (ISPN-6045) TransactionAwareKeyCloseableIterator.remove uses previousValue which is never set
William Burns (JIRA)
issues at jboss.org
Wed Oct 5 15:44:00 EDT 2016
[ https://issues.jboss.org/browse/ISPN-6045?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
William Burns updated ISPN-6045:
--------------------------------
Git Pull Request: https://github.com/infinispan/infinispan/pull/4595
> TransactionAwareKeyCloseableIterator.remove uses previousValue which is never set
> ---------------------------------------------------------------------------------
>
> Key: ISPN-6045
> URL: https://issues.jboss.org/browse/ISPN-6045
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 8.1.0.Final
> Reporter: Patrick Ruckstuhl
> Assignee: William Burns
> Fix For: 9.0.0.Beta1, 8.2.5.Final, 8.1.6.Final
>
>
> TransactionAwareKeyCloseableIterator.remove is implemented as
> {code:java}
> cache.remove(previousValue);
> {code}
> But looking at the previousValue it never gets set. This results then in
> {code}
> java.lang.NullPointerException: Null keys are not supported!
> at org.infinispan.cache.impl.CacheImpl.assertKeyNotNull(CacheImpl.java:224)
> at org.infinispan.cache.impl.CacheImpl.remove(CacheImpl.java:547)
> at org.infinispan.cache.impl.CacheImpl.remove(CacheImpl.java:543)
> at org.infinispan.interceptors.TxInterceptor$TransactionAwareKeyCloseableIterator.remove(TxInterceptor.java:568)
> {code}
> I encountered this when trying to switch infinispan from 7.2 to 8.1 in conjunction with hibernate-infinispan 4.3 which does the following code to clear the cache:
> {code:java}
> public static void removeAll(AdvancedCache cache) {
> try {
> Iterator it = cache.keySet().iterator();
> while (it.hasNext()) {
> it.next(); // Necessary to get next element
> it.remove();
> }
> } catch (UnsupportedOperationException e) {
> // Fallback on using clear for older version
> cache.clear();
> }
> }
> {code}
> from https://github.com/hibernate/hibernate-orm/blob/4.3/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/Caches.java
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the infinispan-issues
mailing list