当前位置:网站首页>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事务的特点: 单独的隔离操作,没有隔离级别,不保证原子性
边栏推荐
- uva1325
- ansible各个模块详解
- 服务器磁盘阵列
- flex布局青蛙游戏通关攻略
- Distributed systems revisited: there will never be a perfect consistency scheme...
- Day019 方法重写与相关类的介绍
- Flutter Learning 4 - Basic UI Components
- span标签和p标签的区别
- In the hot summer, teach you to use Xiaomi smart home accessories + Raspberry Pi 4 to connect to Apple HomeKit
- [cesium] 3D Tileset model is loaded and associated with the model tree
猜你喜欢
In the hot summer, teach you to use Xiaomi smart home accessories + Raspberry Pi 4 to connect to Apple HomeKit
MySQL Foundation (1) - Basic Cognition and Operation
Day019 方法重写与相关类的介绍
flex布局青蛙游戏通关攻略
JeeSite New Report
二叉树基本性质+oj题解析
u-boot调试定位手段
span标签和p标签的区别
Redis哨兵模式配置文件详解
Basic properties of binary tree + oj problem analysis
随机推荐
2022杭电多校第一场01
2023年信息与通信工程国际会议(JCICE 2023)
Analyses the mainstream across technology solutions
LAB 信号量实现细节
【无标题】
Analysis of Mvi Architecture
算法---一和零(Kotlin)
Shell(4)条件控制语句
Homework 8.4 Interprocess Communication Pipes and Signals
大学物理---质点运动学
Detailed Explanation of Redis Sentinel Mode Configuration File
1.3 mysql批量插入数据
"PHP8 Beginner's Guide" A brief introduction to PHP
服务器磁盘阵列
[Student Graduation Project] Design and Implementation of the Website Based on the Web Student Information Management System (13 pages)
【软考 系统架构设计师】软件架构设计③ 特定领域软件架构(DSSA)
After controlling the export file in MySQL, it becomes \N. Is there any solution?
MySQL Foundation (1) - Basic Cognition and Operation
dedecms dream weaving tag tag does not support capital letters fix
How to quickly upgrade your Taobao account to a higher level