Hi guys,

going deeper into the JDBM code, I'm currently reviewing the MRU class used into the CacheRecordManager. It has a few flaw I think we should correct (not that the code is wrong, but it can be sanitized. Here are the suggested fixes : - it internally uses a Hashtable, a data structure considered as legacy. One first option would be to use a Map instead (not synchronized, less potential contention) - it has a elements() method which returns an Enumeration on top of all the elements in the cache, used by the CacheRecordManager to determinate which element is dirty.
- it's not synchronized (however, the underlying storage is)

Otherwise, it's strictly a MRU where each updated element is moved to the top of the list, the oldest one being evicted. Some listeners can be called in this case.

Here, we may want to either use an external library (ehcache which is using an ASL 2.0 license?) Any other idea ?

--
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com


Reply via email to