Open nekhtan opened 2 months ago
Thanks for your comments. You are welcome to contribute a proposed improvement to the handling, via a pull request. Yes, the current maxSize handling is simple; it provides a reference for people to improve upon for their specific situation. When we have a better implementation that can become the default.
I don't see anything broken in the current implementation on the face of it. putAll(10) in your example will try to put each of the 10 new objects one by one and will be successful with the first 8 until size() reaches 10. The last 2 will be rejected.
Hello,
It seems that the
datanucleus.cache.level2.maxsize
feature is only preventing the cache from storing more objects once it reaches the defined limit. Would that be possible to change this behavior so that it starts evicting idle entries when the threshold is near (or even reached if it's easier to do) ?Also, looking at the
AbstractReferencedLevel2Cache
, since theputAll
method does not implement themaxSize
feature and theput
method checks for equality, isn't it possible that even the implemented feature (on theput
) is broken because the threshold is exceeded following a call toputAll
?Example:
Thanks in advance for your insight !