Feb 24th, 2010, 03:49 PM
Spring 2.5.6 broke ibatis caching
I am hoping someone else has already solved this problem. The project I am on has been using spring and ibatis for some time now. After upgrading from spring 2.0.x to 2.5.6 for spring, the ibatis cache stopped working.
We looked as at the simplest tables in our code base where there were no joines being done, just straight get, insert, update commands. Caching is enabled, but the cache is no longer being used. I know the ibatis code is correct as it worked prior to the 2.5.6 upgrade.
Is there some new configuration changes that need to be made to get it to work? We have a release coming up soon and need to find a resolution. Thanks for your help!
Here si the cacheModel definition
<cacheModel id="locationType_cache" type="LRU" readOnly="false" serialize="false">
<property name="size" value="10"/>
Here is the ibatis sql being run
<select id="getAllLocationTypes" cacheModel="locationType_cache" resultMap="location-type-map">
<!-- include refid="select_location_type_fragment"/ -->
ORDER BY location_type_nm
I wrote a simple JUnit test to verify that it was not working.
I injected the ibatis dao into the test class, I also injected the dastsource, so that I could use the spring SimpleJdbcInsert to verify that the caching was broken. I retrieved the list of objects using the ibatis dao, the length was 3, using spring SimpleJdbcInsert, I bypassed ibatis and inserted another object. Then using the ibatis dao, I retrieved the list again. If caching was working the list should still be at 3, however it came back with 4.
We validated the caching was no longer working through several other manual ways too.
Any help on how to get the caching working again would be greatly appreciated.
Feb 24th, 2010, 05:12 PM
Cache model changed
I must print a retraction. After much more review, I discovered that the cache model was in fact changed in addition to upgrading to 2.5.6. The parameters readOnly and serialize were added, and the values that were selected for those are what caused the caching to fail.
Tags for this Thread