当前位置:网站首页>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事务的特点: 单独的隔离操作,没有隔离级别,不保证原子性
边栏推荐
- Basic properties of binary tree + oj problem analysis
- 1.3 mysql batch insert data
- Flutter learning - the beginning
- Flutter learning three-Flutter basic structure and principle
- Shell(4)条件控制语句
- Requests库部署与常用函数讲解
- phone call function
- Flutter real machine running and simulator running
- Flutter学习三-Flutter基本结构和原理
- 【cesium】元素高亮显示
猜你喜欢

二叉树基本性质+oj题解析

JeeSite New Report

数字孪生技术在电力系统中的应用现状

"Recursion" recursion concept and typical examples

Qt produces 18 frames of Cupid to express his love, is it your Cupid!!!

Flutter real machine running and simulator running

server disk array

请写出SparkSQL语句

Structured light 3D reconstruction (1) Striped structured light 3D reconstruction

The difference between span tag and p
随机推荐
[Student Graduation Project] Design and Implementation of the Website Based on the Web Student Information Management System (13 pages)
Flutter Learning 4 - Basic UI Components
1068找到更多的硬币
Qt produces 18 frames of Cupid to express his love, is it your Cupid!!!
shell函数
Excel画图
1.3 mysql批量插入数据
dedecms dream weaving tag tag does not support capital letters fix
逆向理论知识4
判断语句_switch与case
uboot enable debug printing information
"Recursion" recursion concept and typical examples
Day019 Method overriding and introduction of related classes
Dephi reverse tool Dede exports function name MAP and imports it into IDA
Flutter learning 5-integration-packaging-publish
1.3 mysql batch insert data
LeetCode:1403. 非递增顺序的最小子序列【贪心】
Flutter学习-开篇
C language - vernacular to understand the original code, inverse code and complement code
Understanding and use of C# on set() and get() methods