ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <simone.trip...@gmail.com>
Subject Re: [iBatis 3] Cache troubles
Date Wed, 18 Nov 2009 09:37:08 GMT
Hi Clinton,
unfortunately the official version of Memcached - the one we've been
using on production for years - doesn't support namespaces/tags, there
is a patched version called Memcached-tags[1] but isn't officially
supported :(
Can you provide me please any idea how to supply this lack? Is there
any way to obtain the cache group, speaking in iBatis2 therms?
Thanks in advance, best regards
Simone

[1] http://code.google.com/p/memcached-tag/

On Wed, Nov 18, 2009 at 7:49 AM, Simone Tripodi
<simone.tripodi@gmail.com> wrote:
> Hi Clinton,
> thanks for your kind reply, I'll let you know ASAP the results of my
> tries if you're interested on :)
> Best regards,
> Simone
>
> On Wed, Nov 18, 2009 at 12:25 AM, Clinton Begin <clinton.begin@gmail.com> wrote:
>> I'll try to answer in two short statements to see if that helps.  I won't
>> have time to look through the code anytime soon...
>>
>>   * I think you can solve the first problem of flushing the whole cache by
>> passing the cache's namespace to memcached as a cache domain (I'm not sure
>> what memcached calls them, but essentially flush only a partition or group
>> of the cached elements (OSCache calls this a domain I believe).
>>
>>   * The putObject isn't called until the end of the session, or when commit
>> is called.  It's a transactional cache, so if you rollback a transaction
>> before closing the session or committing... the cache won't be updated with
>> potentially erroneous or inconsistent data.
>>
>> Hope that helps,
>> Clinton
>>
>> On Tue, Nov 17, 2009 at 1:23 PM, Simone Tripodi <simone.tripodi@gmail.com>
>> wrote:
>>>
>>> Hi all guys,
>>> I've been doing some experiment using the last beta of iBatis 3 and
>>> I've the feeling you happily fixed the inglorious IBATIS-555 issue
>>> about the CacheKey unique hashcode generation on different JVMs :)
>>>
>>> Now I've been porting my old stuff to the new iBatis implementation
>>> and everything has worked fine until I plugged-in the cache, I really
>>> hope you can help me to understand where I'm wrong: I implemented a
>>> Memcached-based Cache class, wrapping the spy memcached client
>>> (code.google.com/p/spymemcached/), injecting a singleton instance to
>>> the Configuration programmatically using google-guice 2 and finally
>>> referenced in the sql-map via the snippet:
>>>
>>> <cache-ref namespace="memcached"/>
>>>
>>> What I noticed, reading the logs, is the following:
>>> * when flushing the statements defined in the sql map, is called the
>>> method org.apache.ibatis.cache.Cache#clear(): that makes me a little
>>> worried, because in a memcached context I ideally want to use just one
>>> memcached client instance and reference it in the whole application,
>>> when performing an insert operation I wouldn't flush the whole cache,
>>> but rather remove only the interested statements; since I'm still used
>>> to the old iBatis2 cache model, how can I fix it?
>>> * no data is cached, the method
>>> org.apache.ibatis.cache.Cache#putObject(Object,Object) is never
>>> called;
>>>
>>> All the code I've been producing is public, you can find it on
>>> google-code[1], and on the test directory you can find the scenario[2]
>>> I described
>>>
>>> Thanks in advance for your help, any kind of suggestion will be very
>>> appreciated!!!
>>> Simone
>>>
>>>
>>> [1] http://code.google.com/p/ibaguice/source/browse/#svn/trunk
>>> [2]
>>> http://code.google.com/p/ibaguice/source/browse/trunk/src/test/java/com/ibaguice/SimpleTestCase.java
>>> --
>>> http://www.google.com/profiles/simone.tripodi
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>>
>>
>>
>
>
>
> --
> http://www.google.com/profiles/simone.tripodi
>



-- 
http://www.google.com/profiles/simone.tripodi

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message