Hello Slava,

the workaround totally works for me, I already have an Interceptor for certain caches anyway. Thanks a lot for looking into this. Will you take care of the jira ticket, too?

Cheers
Wolfram

On 23/01/2018 06:19, slava.koptilin wrote:
Hello,

Here is the SQL statement and the exception from the logs:
https://gist.github.com/wolframite/d0b28d8b7ce483f82b9fd145adb68abe
I tried this use-case with cache configuration you provided and I was able
to reproduce the issue.
When insert/update operation is executed via SQL api, the actual value of
the entry has the BinaryObject type instead of MemcachedEntry. It looks like
a bug, unfortunately.

As a temporary workaround, you can implement CacheInterceptor in the
following way:
public class CompressionInterceptor extends CacheInterceptorAdapter {
     @Override public Object onBeforePut(Cache.Entry entry, Object newVal) {
         if (newVal instanceof BinaryObject) {
             // value is updated via SQL
             BinaryObject newVal0 = (BinaryObject) newVal;

             ...
         }
         else {
             // value is updated via JCache api
             MemcachedEntry newVal0 = (MemcachedEntry) newVal;
             ...
         }
         ...
     }
}

Thanks,
Slava.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to