10 Analyze SurfaceComposerClient submission transaction process

After using SurfaceComposerClient::createSurface to create a SurfaceControl, the SurfaceControl can create a Surface for drawing. But what if you want to configure Surface’s zorder, position and other attributes? Methods for configuring properties are provided in SurfaceComposerClient::Transaction. SurfaceComposerClient::Transaction::setXXX() For example, in “02 The Simplest SurfaceFlinger Application”, zorder is configured to be the largest, the display position […]

03-Sping transaction implementation: XML-based implementation of declarative transactions

XML implementation of declarative transactions Development steps Step 1: Introduce AOP-related aspectj dependencies <!–aspectj dependency–> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>6.0.0-M2</version> </dependency> Step 2: Write the dao layer interface and its implementation class public interface AccountDao {<!– –> // Check the balance based on the account number Account selectByActno(String actno); //Update account information int update(Account act); } […]

[MySQL Transactions] Multi-version Concurrency Control (MVCC)

Multi-version Concurrency Control (MVCC) Article directory Multi-version Concurrency Control (MVCC) 1 Overview 2. Snapshot reading and current reading 2.1 Snapshot reading 2.2 Current reading 3. MVCC implementation principle of ReadView 3.1 ReadView Overview 3.2 Design ideas 3.3 ReadView rules 3.4 MVCC overall operation process 4. Give examples 4.1 READ COMMITTED isolation level 4.2 REPEATABLE READ […]

01-The implementation of transactions in Spring: programmatic transactions and declarative transactions

Abnormal bank account transfer Requirement: To transfer 10,000 from act-001 account to act-002 account, it is required that one of the balances of the two accounts is successfully reduced and the other is added successfully, that is, the two update statements executed must succeed or fail at the same time Implementation steps Step 1: Introduce […]

Implementing eventually consistent distributed transactions for placing orders and reducing inventory based on RabbitMQ

The National Day holiday really gave me a break, and the update progress was slow. Now that the status has finally been adjusted back, continue to update. Without further ado, let me show you the overall data flow diagram. Text Interpretation Step 1: The user places an order and calls the order service. We directly […]

Asynchronously process CompletableFuture data operations and use DefaultTransactionDefinition to ensure transaction consistency

package *.utils; import lombok.extern.slf4j.Slf4j; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionStatus; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; @Slf4j public class ThreadTransationUtil { private final PlatformTransactionManager transactionManager; public ThreadTransationUtil(PlatformTransactionManager transactionManager) { this.transactionManager = transactionManager; } public void threadBlocking(CountDownLatch latch, TransactionStatus status, AtomicBoolean isException) throws InterruptedException { latch.countDown(); log.info(“Start hovering, remaining count: {}”, latch.getCount()); latch.await(); if(isException.get()){ log.info(“Start rollback”); transactionManager.rollback(status); }else{ log.info(“Start submission:{}”,status); […]

mysql user rights management index transaction storage engine

DDL:CTETATE DROP ALTER dml: manage data update insert into delete truncate dql: query statement select dcl: permission control statement grant revoke User rights management: create user ‘username’@’20.0.0.51’ idetified by ‘123456’; grant all select,insert,drop set password =password(‘123456’) set password for ‘username’@’localhost’ = password(‘adc123’); show grants for ‘root’@’20.0.0.51’; flush privileges; Permissions Permission Description Permission Level td> create […]

Mysql exception: Lock wait timeout exceeded; solution to try restarting transaction

Problem phenomenon The interface response time is too long, and it takes dozens of seconds to return an error message. The error Lock wait timeout exceeded; try restarting transaction appears in the background log. <– java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794) […]

MySQL–constraints, multi-table queries, transactions, three paradigms

1. Constraints Constraints are rules that act on the fields of a table to limit the data stored in the table. 2. Purpose: Ensure the accuracy, validity and integrity of data in the database 3. Classification Constraints Description Keywords Non-empty constraints Restrictions This field cannot be empty NOT NULL Unique constraint Ensure that the data […]

Series 42: Spring transaction propagation behavior case demonstration (2) #REQUIRED

1. Demonstrate Spring’s default propagation behavior (REQUIRED) 1.1. Data in the table before running 1.2, StockServiceImplREQUIRED /** * @Author: A leaf of duckweed returns to the sea * @Date: 2023/10/30 15:43 * @Description: Demonstrates the propagation behavior of REQUIRED * There is no external transaction: open a new transaction * External existing transaction: added to […]