Spring Redis Delete не удаляет ключ

Я пытаюсь удалить ключ redis, но по какой-то причине он не удаляется, но и не выдает исключение. Вот мой код для удаления:

import com.example.service.CustomerService;
import com.example.model.Customer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.*;

@Service
public class RedisCustomerService implements CustomerService {

    @Autowired
    private RedisTemplate<String, Object> redisTemplate; 

    private String uniqueIdKey = "customerId";

    private BigInteger uniqueId() {
        long uniqueId = this.redisTemplate.opsForValue().increment(uniqueIdKey, 1);
        return BigInteger.valueOf(uniqueId);
    }

    private String lastNameKey(BigInteger id) {
        return "customer:ln:" + id;
    }

    private String firstNameKey(BigInteger id) {
        return "customer:fn:" + id;
    }

    @Override
    public void deleteCustomer(BigInteger id) {
        redisTemplate.opsForValue().getOperations().delete(String.valueOf(id));
    }
}
8
задан Thys Andries Michels 10 January 2014 в 18:36
поделиться