DATAREDIS-510 - Fix caching of null values.
We now no longer add empty byte[] as cache value but return null instead. Original pull request: #201.
This commit is contained in:
committed by
Mark Paluch
parent
28b5d61029
commit
67106bc75a
@@ -686,10 +686,14 @@ public class RedisCache implements Cache {
|
||||
connection.multi();
|
||||
}
|
||||
|
||||
connection.set(element.getKeyBytes(), element.get());
|
||||
if (element.get().length == 0) {
|
||||
connection.del(element.getKeyBytes());
|
||||
} else {
|
||||
connection.set(element.getKeyBytes(), element.get());
|
||||
|
||||
processKeyExpiration(element, connection);
|
||||
maintainKnownKeys(element, connection);
|
||||
processKeyExpiration(element, connection);
|
||||
maintainKnownKeys(element, connection);
|
||||
}
|
||||
|
||||
if (!isClusterConnection(connection)) {
|
||||
connection.exec();
|
||||
|
||||
Reference in New Issue
Block a user