ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@apache.org>
Subject Re: javax.cache close()
Date Fri, 01 May 2015 19:17:19 GMT
On 01.05.2015 13:57, Ognen Duzlevski wrote:
> On Fri, May 1, 2015 at 12:59 AM, Andrey Kornev <andrewkornev@hotmail.com>
> wrote:
>
>> Dmitriy,
>> It seems the JCache spec doesn't explicitly require the cache data to be
>> destroyed by a Cache.close() call. See page 38.
>> The way I interpret (perhaps incorrectly) the semantics on the close() is
>> more like closing of an OS file: all data structures and buffers allocated
>> and managed by the OS kernel on behalf of an application get released, but
>> the file and its data are still there. It's just the application no longer
>> holds a handle to it...
>> Essentially, Cache.close() closes a specific *instance* of the cache
>> class. That instance becomes unusable from this moment on, but other
>> instances of the Cache class for the same named cache may still be alive
>> and kickin'.According to the spec to actually destroy the cache and its
>> data one should use CacheManager.destroyCache(cacheName)
>> instead.RegardsAndrey
>>
> Andrey, hah, that was exactly my expectation. Imagine my surprise when I
> found out that a client  app I wrote obliterated a multi Gb+ cache in one
> operation (close) ;)

Yeah, that really violates the principle of least surprise. No amount of
javadoc explanations can fix that ... I'd categorize this as an API
implementation bug.

-- Brane

Mime
View raw message