[ 
https://issues.apache.org/jira/browse/IGNITE-2786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942510#comment-15942510
 ] 

Rishi commented on IGNITE-2786:
-------------------------------

The fix can be applied as follows with SpringCacheManager -

1) Design was to listen for ignite re connect event
2) And clear the cache on reconnect

See the following code below and let us know if this is helpful -

In afterPropertiesSet -

//Handles the reconnect event, on server crashes OR network failure, client
connects to server and
        // destroy the cache
        IgnitePredicate<DiscoveryEvent> lsnr = iEvt -> {
            LOGGER.info("Received discovery event [iEvt=" + iEvt.name() + ",
discovery=" + iEvt.shortDisplay() + ']');

            caches.keySet().forEach(key -> {
                ignite.destroyCache(key);
                caches.remove(key);
            } );



Let me know if you see any side effects with the fix.

> SpringCache doesn't survive client reconnect
> --------------------------------------------
>
>                 Key: IGNITE-2786
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2786
>             Project: Ignite
>          Issue Type: Improvement
>          Components: cache
>    Affects Versions: 1.5.0.final
>            Reporter: Valentin Kulichenko
>             Fix For: 2.0
>
>
> After a client disconnects and reconnects with new ID, Spring caching can't 
> be used, because existing cache instance are closed.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to