Hello,
I am facing a problem with the Play Cache. When using the incr(myKey) method, the cache content type must be different according to the cache implementation used.
When using the default ehCache implementation, the cache entry pointed by the key must be a numeric type (integer...) otherwise I get an exception:
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
at play.cache.EhCacheImpl.incr(EhCacheImpl.java:92)
at play.cache.Cache.incr(Cache.java:146)
When using the memcached implementation the content must be a String..., otherwise I get that exception:
OperationException: CLIENT: CLIENT_ERROR cannot increment or decrement non-numeric value
at net.spy.memcached.protocol.BaseOperationImpl.handleError(BaseOperationImpl.java:126)
Any idea on what I am supposed to do to be able to switch cache implementation at will?
Cheers.
Jérôme