This article is applied through the Watch (monitoring) +mutil (transaction) implementation to the relevant scenarios such as distributed high concurrency processing. The bottom of the Redis-cli.exe to test multiple thread modifications, encountered problems and solve the problem.High concurrency to modify the same key encountered problems:1) Define a hash type of Key
For an already existing key, we can set its expiration time, after that time, when you visit again, key will not existThere are two ways to set the expiration time, one is to specify how long the key will survive from the current time, the time unit has two, one is the second, the other is the millisecondThe second way is to specify the
The first step is to modify the configuration file
############################# EVENT NOTIFICATION ############################### Redis can notify Pub/sub clients about events happening in the key space.# This feature was documented at Http://redis.io/topics/notifications## for instance if Keyspace events notification is enabled, and a client# performs a DEL operation on
Redis is a high-performance Key-value database.The emergence of Redis, to a large extent, compensates for the lack of memcached such keyvalue storage, in some cases can be a good complement to the relational database.Redis is essentially a key-value database, but it also absorbs the advantages of some relational databa
hashing (hash)The Hash type in Redis can be seen as a map container with string key and string value. This type is ideal for storing object information. such as the user's username password and so on. Each Hash can store 4,294,967,295 key-value pairs
Storage (Hset)
Hset key field Value field does not exist and is stor
Redis.clients.jedis.exceptions.JedisDataException:WRONGTYPE Operation against a key holding the wrong kind of value
Today to change the code, a run ran wrong, the wrong reason:
Because the same key already exists in the Redis, and the value type of the key is not set, it is Sortset (before the change), and the error
A problem occurred when inserting data using Jedis:
Redis.clients.jedis.exceptions.JedisDataException:WRONGTYPE Operation against a key holding the wrong kind of value
This is probably how the code is implemented:
hashmap
It doesn't look like the value type is wrong. It turns out that the same key already exists in the Redis database, and that the value ty
An issue occurred when inserting data using Jedis:Redis.clients.jedis.exceptions.JedisDataException:WRONGTYPE operation against a key holding the wrong kind of value
The code is probably implemented like this:
hashmap
There seems to be no value type that looks wrong. It turns out that the same key already exists in the Redis database, and that the value type f
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.