In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the use of transactionmanager, the article is very detailed, has a certain reference value, interested friends must read it!
First acquaintance of transactionmanager
A transaction is a logical set of operations that either succeed or fail.
Transactions have ACID features. Refer to Baidu encyclopedia as follows:
Atomicity (Atomicity): all operations in the whole transaction are either completed or not completed, and cannot be stuck in the middle.
Consistency: transactions must always keep the system in a consistent state, regardless of the number of concurrent transactions at any given time.
Isolation: transactions are executed in an isolated state so that they appear to be the only operations performed by the system at a given time.
Durability: after the transaction completes, the changes made by the transaction to the database are persisted in the database and are not rolled back.
Transactionmanager core interface API
Image
As shown in the figure above, there are three main high-level abstractions for Spring transaction management:
PlatformTransactionManager: transaction manager (used to manage transactions, including transaction commit, rollback)
TransactionDefinition: transaction definition information (isolation, propagation, timeout, read-only)
TransactionStatus: specific running status of the transaction
PlatformTransactionManager Core transaction Manager
Is the core interface of Spring's transaction manager.
Spring itself does not support transaction implementation, but is responsible for wrapping the underlying transaction. What kind of transaction strategy is supported by the application, what kind of transaction strategy Spring supports.
It provides common ways to manipulate transactions:
TransactionStatusgetTransaction (TransactionDefinitiondefinition): get transaction status information
Voidcommit (TransactionStatusstatus): commit transaction
Voidrollback (TransactionStatusstatus): rollback transactions
PublicinterfacePlatformTransactionManager (). {
/ / get the TransactionStatus object from TransactionDefinition
TransactionStatusgetTransaction (TransactionDefinitiondefinition) throwsTransactionException
/ / submit
Voidcommit (TransactionStatusstatus) throwsTransactionException
/ / rollback
Voidrollback (TransactionStatusstatus) throwsTransactionException
}
The above is all the content of this article "what's the use of transactionmanager?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.