当前位置:网站首页>redis事务
redis事务
2022-08-05 05:12:00 【价值成长】
事务: 一组命令的集合。一个事务中所有命令都会序列化,按顺序地串行化执行而不会被其他命令插入,不许加塞。
作用: 一个队列中,一次性,顺序性,排他性的执行一系列命令。
0. 常用命令 EXEC 执行事务; MULTI 开启事务
1. 放弃事务 DISCARD
2. 全体连坐 一次性全部成功或失败,单次执行过程就报错了,比较严重的错误
3. 冤头寨主 谁错找谁,单次执行没报错,已经加入队列,最终执行事务报错,一般错误
4. watch监控 WATCH UNWATCH 类似乐观锁 CAS: Check and Set
UNWATCH 之前所有的锁失效。
事务三阶段:
开启:以MULTI开启一个事务
入队:将多个命令入队到事务中,接到这些命令不会立即执行,而是放到等待执行事务的队列中
执行:由EXEC命令触发事务
redis事务的特点: 单独的隔离操作,没有隔离级别,不保证原子性
边栏推荐
猜你喜欢

RL reinforcement learning summary (1)

基于Web的商城后台管理系统的设计与实现
![[Surveying] Quick Summary - Excerpt from Gaoshu Gang](/img/35/e5c5349b8d4ccf9203c432a9aaee7b.png)
[Surveying] Quick Summary - Excerpt from Gaoshu Gang

The mall background management system based on Web design and implementation

大学物理---质点运动学

Excel画图

University Physics---Particle Kinematics

jvm 三 之堆与栈

【学生毕业设计】基于web学生信息管理系统网站的设计与实现(13个页面)

A blog clears the Redis technology stack
随机推荐
Basic properties of binary tree + oj problem analysis
[cesium] element highlighting
Structured light 3D reconstruction (1) Striped structured light 3D reconstruction
多线程查询结果,添加List集合
Day14 jenkins deployment
Develop a highly fault-tolerant distributed system
Excel画图
人性的弱点
Flutter学习三-Flutter基本结构和原理
C语言-大白话理解原码,反码和补码
u-boot in u-boot, dm-pre-reloc
number_gets the specified number of decimals
Day019 方法重写与相关类的介绍
dedecms后台生成提示读取频道信息失败的解决方法
重新审视分布式系统:永远不会有完美的一致性方案……
[Surveying] Quick Summary - Excerpt from Gaoshu Gang
Day14 jenkins部署
电话溥功能
How to identify false evidence and evidence?
8.04 Day35-----MVC three-tier architecture