[
https://hibernate.onjira.com/browse/HHH-7256?page=com.atlassian.jira.plug...
]
Galder Zamarreno commented on HHH-7256:
---------------------------------------
I've fixed this by adding a containsKey(). Not the most efficient, but at least we
avoid potential confusion down the line with the number of put calls. Long term, as I
mentioned in the email discussion, we should consider delegating stats generation to the
cache providers themselves.
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
Fix For: 4.1.3
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