
事务
文章平均质量分 64
自驱
ALOHA HEJA HE
展开
-
为什么数据库关闭默认事务性能会提升
因此,在系统设计上,我们应尽量避免在MySQL中写入事务并关闭MySQL的事务处理功能,以改善MySQL的性能。MySQL中,使用事务处理的数据库查询和操作的性能比不使用事务的查询和操作大大低下,这是因为当 MySQL 开启事务,MySQL 就会多了一些额外的步骤,比如查询时需要检查锁情况,设置锁的范围,维护更新的日志,管理事务的隔离级别,等等步骤,这些步骤会消耗 MySQL 服务器的硬件资源,造成查询操作变慢。原创 2023-03-10 21:05:48 · 279 阅读 · 0 评论 -
golang gorm事务踩坑记
1 源码package gormimport ( "fmt" "regexp" "strings" "gorm.io/gorm/clause" "gorm.io/gorm/utils")// Model specify the model you would like to run db operations// // update all users's name to `hello`// db.Model(&User{}).Update("name",原创 2021-08-02 15:30:40 · 2046 阅读 · 0 评论 -
【Mysql】quick review 分布式事务 存储 redo undo all-in-one
1 存储引擎存储引擎主要有: 1. MyIsam , 2. InnoDB, 3. Memory, 4. Archive, 5. Federated1.1 InnoDB(B+树):InnoDB 底层存储结构为B+树, B树的每个节点对应innodb的一个page,page大小是固定的, 一般设为 16k。其中非叶子节点只有键值,叶子节点包含完成数据。适用场景: 经常更新的表,适合处理多重并发的更新请求。 支持事务。 可以从灾难中恢复(通过 bin-log 日志等) 外键约束。只有他支持外键原创 2021-02-19 18:40:10 · 279 阅读 · 1 评论 -
【ACID】C不属于ACID,一致性不属于ACID,为什么?
1 C 的含义The word consistency is terribly overloaded:重载含义四个• Replica consistency and the issue of eventual consistency that arises in asynchronously replicated systems . • Consistent hashing is an approach to partitioning that some systems use for rebal原创 2021-01-21 09:12:10 · 400 阅读 · 1 评论 -
【DRDS分布式事务】分布式事务
1 分布式事务2 使用// 1import org.springframework.jdbc.datasource.DataSourceTransactionManager;import org.springframework.transaction.TransactionDefinition;import javax.sql.DataSource;import java.sql.Connection;import java.sql.SQLException;import java.原创 2020-05-24 15:51:41 · 791 阅读 · 0 评论 -
redis pipeline 事务到底怎么回事呢? 怎么执行的?
MULTI,EXEC,DISCARDandWATCHare the foundation of transactions in Redis.They allow the execution of a group of commands in a single step, with two important guarantees: All the commands in a tr...原创 2019-04-25 11:47:27 · 824 阅读 · 0 评论 -
【数据库事务】--事务死锁与检测
单机事务1 死锁产生原因 A 两个线程 B 不同方向 C 相同资源2 解决方案 A 尽可能不死锁 B 碰撞检测 (获取锁,去看另一个事务持有的锁) (主流数据库)C 等锁超时原创 2017-11-05 20:18:53 · 351 阅读 · 0 评论 -
【数据库事务】--事务传播子方法事务失效(老张)
1 AOP的配置xml expose-proxy="true"暴露代理对象2 子类中获取代理,使事务生效(方法一)org.springframework.aop.framework.AopContext#currentProxy 调用方法method3 方法二:使用ApplicationContext获取对应的代理类调用方法method原创 2017-11-05 18:34:26 · 708 阅读 · 0 评论 -
知识库--Limitations of STM 【高并发写 not in favor】(137)
STM的优点 STM eliminates explicit synchronization. We no longer have to worry if we forgot to synchronize or if we synchronized at the wrong level. There are no issues of failing to cross the memory barr翻译 2017-03-10 08:32:58 · 505 阅读 · 0 评论 -
知识库--Akka 事务配置-using jvm(134)
Akka assumes a number of default settings, but it allows us to change these either programmatically or through the configuration file akka.conf.使用编程方式配置事务 We can programmatically change the settings o翻译 2017-03-07 08:46:50 · 362 阅读 · 0 评论 -
知识库--Creating Nested Transactions By Akka 内存嵌套事务(129)
public class Account { final private Ref<Integer> balance = new Ref<Integer>(); public Account(int initialBalance) { balance.swap(initialBalance);//自带事务 } public int getBalanc翻译 2017-03-02 08:28:33 · 483 阅读 · 0 评论