[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7256) Infinispan second level cache should react to minimal puts in putFromLoad impl

Steve Ebersole (JIRA) noreply at atlassian.com
Tue Apr 17 11:56:48 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-7256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46321#comment-46321 ] 

Steve Ebersole commented on HHH-7256:
-------------------------------------

Galder, I agree that the the better solution, as you pointed out in our email discussion, is to have the underlying Infinispan contracts return boolean from the putForExternalRead calls to indicate whether the put actually added data.  That avoids the need to do an inefficient preliminary lookup in order to see if the put should be circumvented.  And it allows the cache stats to be accurate.

> Infinispan second level cache should react to minimal puts in putFromLoad impl
> ------------------------------------------------------------------------------
>
>                 Key: HHH-7256
>                 URL: https://hibernate.onjira.com/browse/HHH-7256
>             Project: Hibernate ORM
>          Issue Type: Improvement
>          Components: caching (L2)
>            Reporter: Galder Zamarreno
>            Assignee: Galder Zamarreno
>
> When entities are loaded multiple times, it could happen that two consecutive Cache.putForExternalRead() operations are called with the second not affecting the cache if a an entry is already present.
> However, from a cache put statistics will increase, resulting potentially in a huge number when in reality, the number of actual cache updates has been pretty small. The minimalPuts parameter is there to avoid this, implying that maybe a check if the key is present should be added since PFER does not return a boolean or similar.
> Although adding that check looks something obvious, it's something that we're probably reluctant to do, because since caches are configured with storeAsBinary=true, it could lead to unmarshalling, slowing things down.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list