You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm revisiting the use of mybatis/ehcache-cache in a web application. I have setup a few MyBatis mappers to use org.mybatis.caches.ehcache.EhcacheCache and I have them configured via a central ehcache.xml file with individual cache managers () configured for each mapper.
Using a profiler and viewing MBeans for net.sf.ehcache, I can see the mappers being setup according to my configuration, what I don't see is a respect for the maxBytesLocalDisk setting I provide. In other words, as I query my website, and run the disk usage command on my file system, looking at the mybatis cache path, the disk usage seems to grow without limit.
I've tried both setting a global maxBytesLocal disk as well as a maxBytesLocalDisk at an individual cache manager level. Below is my latest setup.
For testing I currently have mybatis.cache.maxBytesLocalDisk set to 10M, but I'm already at 145M after a few queries: du -sh ~/local/apache-tomcat/ehcache/org%002ecbioportal%002epersistence%002emybatis%002e%0053ample%004dapper.data 145M /Users/grossb1/local/apache-tomcat/ehcache/org%002ecbioportal%002epersistence%002emybatis%002e%0053ample%004dapper.data
This latest configuration sets a global maxBytesLocalDisk (within ehcache element), but I've tried to set them at the mapper/cache manager level (within cache element) with the same result.
Any ideas what I'm doing wrong?
Thanks for your time and attention to this matter - and thanks for the library, very useful in my application!
The text was updated successfully, but these errors were encountered:
Sorry this was missed. This class contains what is supported from mybatis. I think you just need to adjust to the other two options for saving to get what you need.
I'm revisiting the use of mybatis/ehcache-cache in a web application. I have setup a few MyBatis mappers to use org.mybatis.caches.ehcache.EhcacheCache and I have them configured via a central ehcache.xml file with individual cache managers () configured for each mapper.
Using a profiler and viewing MBeans for net.sf.ehcache, I can see the mappers being setup according to my configuration, what I don't see is a respect for the maxBytesLocalDisk setting I provide. In other words, as I query my website, and run the disk usage command on my file system, looking at the mybatis cache path, the disk usage seems to grow without limit.
I've tried both setting a global maxBytesLocal disk as well as a maxBytesLocalDisk at an individual cache manager level. Below is my latest setup.
Snippet from mapper.xml file:
<mapper namespace="org.cbioportal.persistence.mybatis.SampleMapper"> <cache readOnly="true" type="org.mybatis.caches.ehcache.EhcacheCache"/>
...
</mapper>
Snippet from ehcache.xml:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false" monitoring="autodetect" maxBytesLocalDisk="${mybatis.cache.maxBytesLocalDisk}" dynamicConfig="true" name="myapp-ehcache">
<cache name="org.cbioportal.persistence.mybatis.SampleMapper" statistics="${mybatis.cache.statistics}" maxEntriesLocalHeap="${mybatis.cache.SampleMapper.entrysize}">
<persistence strategy="localTempSwap"/>
</cache>
</ehcache>
For testing I currently have mybatis.cache.maxBytesLocalDisk set to 10M, but I'm already at 145M after a few queries:
du -sh ~/local/apache-tomcat/ehcache/org%002ecbioportal%002epersistence%002emybatis%002e%0053ample%004dapper.data
145M /Users/grossb1/local/apache-tomcat/ehcache/org%002ecbioportal%002epersistence%002emybatis%002e%0053ample%004dapper.data
This latest configuration sets a global maxBytesLocalDisk (within ehcache element), but I've tried to set them at the mapper/cache manager level (within cache element) with the same result.
Any ideas what I'm doing wrong?
Thanks for your time and attention to this matter - and thanks for the library, very useful in my application!
The text was updated successfully, but these errors were encountered: