当前位置:网站首页>@The problem of cross database query invalidation caused by transactional annotation
@The problem of cross database query invalidation caused by transactional annotation
2022-07-05 03:51:00 【Java Punk】
Related articles :
@Transactional Failure scenarios for annotations , I've seen too many people fall over this problem , A thorough inquiry , Shut up the interviewer _Java Punk The blog of -CSDN Blog Through the study of this article , You will master the general 【6 Kind of 】@Transactional Failure scenarios , And be able to understand their failure principles , Dig the source code into the grave .https://blog.csdn.net/weixin_44259720/article/details/110181822?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165655820616782395348213%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165655820616782395348213&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-4-110181822-null-null.nonecase&utm_term=%40Transactional&spm=1018.2226.3001.4450@Transactional Detailed explanation of annotation parameters , And the usage characteristics of annotations ( The collection edition )_Java Punk The blog of -CSDN Blog _transactional Annotation parameters Through this study , You will deepen your understanding of @Transactional Annotation and understanding of all attributes , You can also learn @Transactional Annotate common failure scenarios 【 At the end of the article 】.https://blog.csdn.net/weixin_44259720/article/details/110138972?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165655820616782395348213%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165655820616782395348213&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-110138972-null-null.nonecase&utm_term=%40Transactional&spm=1018.2226.3001.4450 If necessary , Please take away the relevant articles above .
background
Encountered during development , Record the problem .
It is recommended that a service be connected to a database during development , To realize business-oriented micro service configuration , stay RestFull Layer for business integration of services . however , A few days ago, there was a special case , You need to associate multiple databases in a service to complete the query ( Because several databases do not have their own services , No external HSF Interface ).
In this configuration , It is inevitable to query multiple databases in an interface , And need to modify the data .
problem
Due to the addition of @Transactional annotation , The original intention is to realize transaction management , It didn't actually come true , Instead, the database switching failed (master - > slave Failure ), Finally, the data query fails .
terms of settlement
Need to use cross library solutions , Cross database transaction middleware is recommended , Message middle table , Or make use of MQ Achieve best effort notification messages , Achieve the ultimate consistency of data .
边栏推荐
- A brief introduction to the behavior tree of unity AI
- Clickhouse synchronization MySQL (based on materialization engine)
- speed or tempo in classical music
- Huawei MPLS experiment
- Some enterprise interview questions of unity interview
- 官宣!第三届云原生编程挑战赛正式启动!
- Web components series (VII) -- life cycle of custom components
- ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
- LeetCode 237. Delete nodes in the linked list
- [software reverse analysis tool] disassembly and decompilation tool
猜你喜欢
线上故障突突突?如何紧急诊断、排查与恢复
Logstash、Fluentd、Fluent Bit、Vector? How to choose the appropriate open source log collector
Multimedia query
【无标题】
输入的查询SQL语句,是如何执行的?
Blue Bridge Cup single chip microcomputer -- PWM pulse width modulation
[wp]bmzclub几道题的writeup
官宣!第三届云原生编程挑战赛正式启动!
How to learn to get the embedding matrix e # yyds dry goods inventory #
Basic function learning 02
随机推荐
Yuancosmic ecological panorama [2022 latest]
A brief introduction to the behavior tree of unity AI
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
Solve the problem that sqlyog does not have a schema Designer
Leetcode92. reverse linked list II
测试开发是什么?为什么现在那么多公司都要招聘测试开发?
Basic authorization command for Curl
Kubernetes - identity and authority authentication
How about programmers' eyesight| Daily anecdotes
An elegant program for Euclid‘s algorithm
【软件逆向-基础知识】分析方法、汇编指令体系结构
MindFusion.Virtual Keyboard for WPF
Yyds dry goods inventory embedded matrix
我就一写代码的,王总整天和我谈格局...
[wp][入门]刷弱类型题目
面试汇总:这是一份全面&详细的Android面试指南
深度学习——LSTM基础
Share the newly released web application development framework based on blazor Technology
【软件逆向-分析工具】反汇编和反编译工具
JWT vulnerability recurrence