[Switch] distributed transaction questions and transaction questions
For beginners like us, we may use @ Transactional that spring brings to us. We may know JTA, may use jotm and atomikos, and may encounter some terms such as XA, the database driver that supports XA and many other issues will become increasingly confusing. Naturally, a question is raised, what is the overall picture of a huge transaction system?
2. Questions to be addressed
The following describes a series of problems to be solved.
2.1 For the Transaction Model
- What are the three transaction models? What are their respective features? What are their respective defects?
2.2 spring's support for the transaction model
2.3 specification for distributed transactions
2.4 for JTA
What is JTA? What is JTS?
What is the relationship between JTA and the above specifications?
What are JTA interfaces? What are their respective functions?
The JTA interface has a javax. transaction. TransactionManager. How can we understand it and the aforementioned PlatformTransactionManager? That is, what are their respective responsibilities?
2.5 JTA implementation
Do distributed transactions need to be supported by databases and drivers? Or can the general database and driver be used to implement distributed transactions?
Interfaces such as XADataSource, DataSource, XAConnection, and Connection
Some application servers do not implement JTA, such as tomcat, and some application servers implement JTA, such as JBoss. How is this implemented?
How does jotm and atomikos implement JTA? Do you need database and driver support for XA?
2 PC is often a concept for beginners. How is it embodied in code? How do I simulate 2 pcs?
3. Study Process
Starting from a non-distributed transaction, take the opportunity to understand Spring's support principles for transactions, then transition to distributed transactions, understand the concept of distributed transactions, and analyze the Distributed Transaction frameworks jotm, atomikos, understand their principles for implementing distributed transactions.
3.1 Non-distributed transactions
- 1. disadvantages of jdbc Transaction Development
- 2. Programming transaction principles implemented by spring
- 3. spring uses the declarative transaction interface design and implementation principles implemented by AOP to pave the way for integration with jotm and atomikos.
- 4. After deeply understanding the above example, let's look at the three transaction models, their respective characteristics and defects.
3.2 concepts of distributed transactions
- 1 X/Open DTP model, XA specification, 2 PC
- 2. JTA and JTS concepts
- 3. Understanding of JTA Interface Definition
3.3 JTA implementation
- 1 jotm example and the principle of implementing distributed transactions through source code analysis (how to embody the 2 PC process)
- 2 atomikos examples of non-XADataSource and XADataSource support and the principle of implementing distributed transactions through source code analysis (how to embody the 2 PC process)
- 3. How JBoss supports distributed transactions