ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Tan <erictan...@yahoo.com.sg>
Subject Re: Cached list from queryForList() ...
Date Tue, 07 Nov 2006 16:26:15 GMT
Hi Larry,

Doh! Forgot about that feature. Thanks...

I think a serializable read/write cache is what I need. A different cache object for each
session.

A few questions:

1. Where are the serialized cached objects physically stored?

2. When does the serialized cached object per session get cleaned up? 

3. Can the same cacheModel store different objects? For example, MyObj and List of MyObj.

In other words, can getProduct and getProductList statements use the same cacheModel?

4. Using serializable read/write cache: 
User 1 calls getProductList.
10 products are retrieved and cached as a List within iBatis.
User 1 gets a copy of this List with 10 products. This copy serves as a cached list for User
1's session.
User 1 removes 3 products from his list copy.
Subsequent getProductList calls by User 1 will always return his cached copy of 7 products.

User 2 calls getProductList.
Since there is a cached list of 10 products,User 2 gets a copy of this list with 10 products.
This copy serves as a cached list for User 2's session.
User 2 removes 7 products from his list copy.
Subsequent getProductList calls by User 2 will always return his cached copy of 3 products.


Is this how the serializable read/write cache works?

Thanks,
Eric

----- Original Message ----
From: Larry Meadors <lmeadors@apache.org>
To: user-java@ibatis.apache.org
Sent: Monday, 6 November 2006 11:29:55 PM
Subject: Re: Cached list from queryForList() ...

Yes: Make sure that the cache is not marked as read-only.

Larry


On 11/6/06, Eric Tan <erictankok@yahoo.com.sg> wrote:
>
> Hi,
>
> I was testing Spring Acegi Security's AfterInvocationProviderManager which
> deals with domain object instance security (ACL).
>
> With ibatis caching enabled and queryForList(), I realised that returned
> result list was the actual cached list.
>
> With AfterInvocationProviderManager performing object filtering of the
> returned list, unauthorised objects in the returned list were removed. Which
> means the objects were actually removed from the cached list. Subsequent
> invocations of the same queryForList() would return a smaller list.
>
> Is there any way to configure ibatis to return a copy of the cached list
> instead of the actual cached list?
>
> My current workaround is to return a shallow copy of the cached list.
>
> Thanks,
> Eric
>
>  ________________________________
>  What will the world find in 2020?
>  Leave a part of your 2006 in the Yahoo! Time Capsule. Contribute now!







		
__________________________________ 
What will the world find in 2020? 
Leave a part of your 2006 in the Yahoo! Time Capsule. Contribute now! 
http://timecapsule.yahoo.com/capsule.php?intl=sg
Mime
View raw message