[ 
https://issues.apache.org/jira/browse/JCR-1271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552678
 ] 

Marcel Reutegger commented on JCR-1271:
---------------------------------------

Well, as with any synchronization it will slow down execution. But if I can to 
choose between a correct program and a slightly faster one that is incorrect, I 
will go for the first one...

> NullPointerException when iterating over properties
> ---------------------------------------------------
>
>                 Key: JCR-1271
>                 URL: https://issues.apache.org/jira/browse/JCR-1271
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>         Attachments: JCR-1271.patch, JCR-1271.patch
>
>
> Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, 
> RUN_NUM_SECONDS=120) resulted in a NullPointerException:
> Exception in thread "Thread-11" java.lang.NullPointerException
>       at 
> org.apache.commons.collections.map.AbstractReferenceMap$ReferenceEntry.getValue(AbstractReferenceMap.java:596)
>       at 
> org.apache.commons.collections.map.AbstractReferenceMap.containsKey(AbstractReferenceMap.java:204)
>       at 
> org.apache.jackrabbit.core.state.ItemStateMap.contains(ItemStateMap.java:66)
>       at 
> org.apache.jackrabbit.core.state.ItemStateReferenceCache.isCached(ItemStateReferenceCache.java:91)
>       at 
> org.apache.jackrabbit.core.state.LocalItemStateManager.hasItemState(LocalItemStateManager.java:173)
>       at 
> org.apache.jackrabbit.core.state.XAItemStateManager.hasItemState(XAItemStateManager.java:252)
>       at 
> org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:174)
>       at 
> org.apache.jackrabbit.core.ItemManager.createItemInstance(ItemManager.java:495)
>       at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:326)
>       at 
> org.apache.jackrabbit.core.LazyItemIterator.prefetchNext(LazyItemIterator.java:90)
>       at 
> org.apache.jackrabbit.core.LazyItemIterator.next(LazyItemIterator.java:203)
>       at 
> org.apache.jackrabbit.core.LazyItemIterator.nextProperty(LazyItemIterator.java:118)
>       at 
> org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:64)
>       at 
> org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
>       at java.lang.Thread.run(Thread.java:619)
> The cache is not synchronized and is accessed at the same time by the current 
> thread and another thread that notified ItemStates about changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to