DATAKV-46
Merge branch 'rjc-integration' into temp-detached Conflicts: spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultStringRedisConnection.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnection.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnection.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnection.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/DecodeUtils.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundValueOperations.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundValueOperations.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultValueOperations.java spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ValueOperations.java
This commit is contained in:
@@ -223,13 +223,22 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
return execute(new RedisCallback<List<T>>() {
|
||||
public List<T> doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
connection.openPipeline();
|
||||
Object result = action.doInRedis(connection);
|
||||
if (result != null) {
|
||||
throw new InvalidDataAccessApiUsageException(
|
||||
"Callback cannot returned a non-null value as it gets overwritten by the pipeline");
|
||||
boolean pipelinedClosed = false;
|
||||
try {
|
||||
Object result = action.doInRedis(connection);
|
||||
if (result != null) {
|
||||
throw new InvalidDataAccessApiUsageException(
|
||||
"Callback cannot returned a non-null value as it gets overwritten by the pipeline");
|
||||
}
|
||||
List<byte[]> pipeline = connection.closePipeline();
|
||||
pipelinedClosed = true;
|
||||
return SerializationUtils.deserialize(pipeline, resultSerializer);
|
||||
|
||||
} finally {
|
||||
if (!pipelinedClosed) {
|
||||
connection.closePipeline();
|
||||
}
|
||||
}
|
||||
List<byte[]> pipeline = connection.closePipeline();
|
||||
return SerializationUtils.deserialize(pipeline, resultSerializer);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user