TCC-based transaction processing method and device, electronic equipment and storage medium
In TCC's transaction processing, independent transactions are enabled and amount reserved for each transaction transaction request in the Try stage, the transaction failure problem caused by insufficient account balance is solved, the processing risk is reduced and transaction independence is ensured.
Patent Information
- Application Number
- CN202411774412.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-04
AI Technical Summary
Under the microservice architecture, when TCC's transaction mechanism handles batch transactions, it is easy to cause transaction failure due to insufficient account balance, and then restore to the state before the transaction in the Cancel stage, resulting in processing risks.
In the Try stage of TCC, independent transactions are enabled for each transaction transaction request under the same account identification, and determine whether the account balance meets the transaction amount. If it is satisfied, the amount reserved lock will be performed, and the reserved successful transaction request is used as the target transaction transaction request, and the response is determined and the account balance is updated in the Confirm stage.
By starting independent transactions for each transaction transaction request in the Try stage and making accurate amount reservations, the state returned to the transaction before the transaction is avoided in the Cancel stage, the risk of transaction processing is reduced, and the independence of transaction transaction requests is ensured.