[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3248) org.hibernate.cache.EhCache.toMap() throws NullPointerException

Philippe Girolami (JIRA) noreply at atlassian.com
Fri Jun 20 12:13:34 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30478 ] 

Philippe Girolami commented on HHH-3248:
----------------------------------------

I am seeing the same issue on 3.2.5 with the following setup (for testing purposes)

<cache
            name="mycache"
            maxElementsInMemory="50"
            eternal="false"
            timeToIdleSeconds="60"
            timeToLiveSeconds="60"
            overflowToDisk="false"
            maxElementsOnDisk="0"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
            />
and a servlet to dump that cache attached.

Just use this config on any project you have, you'll see it happen : load an entity. Let it rest for 2 minutes and run the cache Dump

> org.hibernate.cache.EhCache.toMap() throws NullPointerException
> ---------------------------------------------------------------
>
>                 Key: HHH-3248
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3248
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: caching (L2)
>    Affects Versions: 3.2.6
>            Reporter: Kenny MacLeod
>
> The toMap() method of org.hibernate.cache.EhCache is not null-safe.  The expression
> cache.get( key ).getObjectValue() 
> Will throw a NPE, since get(key) may return a null in cases where the key exists in the cache, but the value does not, e.g. if it has expired.
> This should either check for the null, or the list of keys should be obtained using getKeysWithExpiredCheck(), rather than just getKeys().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list