[ 
http://issues.apache.org/jira/browse/IBATIS-222?page=comments#action_12371004 ] 

Sven Boden commented on IBATIS-222:
-----------------------------------

The request to evict objects based on primary key is not really valid as iBATIS 
does not use object identity: the results are cached, not the seperate objects. 
So e.g. if 2 queries would return the "same" object you would find the object 
twice in the cache.

One current solution would be to switch off iBATIS caching and roll your own 
caching on the DAO level. In the future iBATIS caching may be pluggable and it 
will be possible to replace the caching strategy (but that request is open as 
another JIRA).

I would like to close this JIRA on March, 24th.... unless objections appear.

> Evict from cache
> ----------------
>
>          Key: IBATIS-222
>          URL: http://issues.apache.org/jira/browse/IBATIS-222
>      Project: iBatis for Java
>         Type: New Feature
>   Components: SQL Maps
>     Versions: 2.1.6
>     Reporter: Paul Benedict

>
> I use the cache mainly to keep in memory objects which are very expensive to 
> create and are retrieved very often throughout the lifetime of my system. 
> These objects are also updatable and so I need to refresh them when an 
> insert/update is called. 
> The current implemention allows a <flushOnExecute> tag to define the methods 
> to flush, but this is too coarse. I request an enhancement to allow me to 
> evict only certain objects (specified by primary keys) so that I do not have 
> to flush the entire cache for a single object update. It is too costly to 
> throw away 1000s of objects just for one update.
> Either the cache should be exposed through a method so that the developer can 
> programtically evict the correct object or some sort of automated process 
> should do it as such:
> <!-- flush the object in the cache having properties id1 & id2 set to the 
> object just passed into insertArticle -->
> <flushOnExecute method="insertArticle" id="{id1,id2}" 
> I personally prefer having programatic access... at least until IBATIS can do 
> it all for me :)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to