Solution: the transaction is added above the mybatis plus multi data source method, and the data source switching fails
Note: mybatis plus is configured with multiple data sources. After adding transactions, the data source switching fails1, Scene descriptionFor multiple data sources used in the project, Impl has a method: MethodA.@Service
@AllArgsConstructor
@DS("tableA")
public class XXXXServiceImpl extends ServiceImpl<XXXXMapper, XXXX> implements XXXXSe ...
Posted by twister47 on Thu, 10 Mar 2022 03:42:50 +0100
Transaction learning notes
Transaction
What is a transaction?
A smallest non separable work unit;
Usually, a transaction corresponds to a complete business (for example, bank account transfer business, which is the smallest work unit) A complete business requires batch DML(insert, update, delete) statements to be jointly completed
Transactions are only related ...
Posted by MarineX69 on Wed, 09 Mar 2022 13:00:20 +0100
Several scenarios and causes of spring transaction failure
prefaceYou may have seen the spring transaction failure scenario in many articles, so let's take a look at the water today to see if you can harvest something different. Go straight to the topicspring transaction failure scenarios and reasons1. Scenario 1: the service is not hosted to springpublic class TranInvalidCaseWithoutInjectSpring {
...
Posted by ShadowX on Tue, 01 Mar 2022 02:46:06 +0100
Is your DDL execution transactional
Is your DDL execution transactionalRecently, flyway was integrated into the project. In terms of transaction processing in the official document, an interesting paragraph was found:If your database cleanly supports DDL statements within a transaction, failed migrations will always be rolled back (unless they were marked as non-transactional).If ...
Posted by peddel on Sun, 27 Feb 2022 10:42:21 +0100
Discussion of some issues with Spring transactions
When a spring transaction is mentioned, it is reminiscent of four basic characteristics, five isolation levels and seven communication characteristics. I'm sure most people know this, but knowing it's one thing, and using it well is another. When using Spring transactions, I've encountered several serious issues, so I'll make a self-summary her ...
Posted by Kibit on Fri, 11 Feb 2022 22:24:52 +0100
How is the transaction method of Spring transaction source code analysis intercepted by AOP proxy?
1. spring declarative transaction overview
Transaction management is very important for enterprise applications. When an exception occurs, it can ensure the consistency of data. spring supports programmatic transaction management and declarative transaction management.
First, let's take a look at the thing abstraction of the spring framew ...
Posted by gotry on Thu, 03 Feb 2022 03:24:44 +0100
SpringBoot AOP configuring global transactions
The emergence of SpringBoot makes it very easy to use transactions in projects. There are two ways to use them, which are suitable for annotation transactions (declarative transaction management) of small projects and global transactions of large projects.
1. Annotation transactions. (secondary)
There are only two steps to annotate transactio ...
Posted by Chris-the dude on Sat, 29 Jan 2022 18:12:15 +0100
Spring 5 framework notes summary
1. Spring5 transactions
What is a transaction?
Transaction is the most basic unit of database operation. Logically, it is a set of operations. Either all succeed. If one fails, all fail.
Four characteristics of transactions:
Atomicity, consistency, isolation, persistence.
A case we often encounter is the problem of bank transfer.
...
Posted by judgenules on Sun, 16 Jan 2022 13:09:43 +0100
Spring -- transaction propagation (introduction, example explanation, level introduction, code implementation)
Spring (IV) -- transaction propagation (introduction, example explanation, level introduction, code implementation)
1, Transaction propagation
1. Transactional communication introduction
Spring defines an enumeration class to facilitate the use of transaction propagation behavior:
2. Transaction propagation example explanation
Or use th ...
Posted by webbwbb on Sun, 09 Jan 2022 11:05:49 +0100
Distributed transaction series tutorial - Chapter 4 - XA solution to solve distributed transactions
Distributed transaction series tutorial - Chapter 4 - XA solution to solve distributed transactions
1, XA solution
Xa is a distributed transaction protocol proposed by Tuxedo. Xa is roughly divided into two parts: transaction manager (TM) and resource manager (RM). The resource manager (RM) is implemented by databases, such as Oracle and DB2. ...
Posted by FamousMortimer on Thu, 23 Dec 2021 14:13:18 +0100