当前位置:网站首页>@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 .
边栏推荐
- speed or tempo in classical music
- 特殊版:SpreadJS v15.1 VS SpreadJS v15.0
- [groovy] string (string splicing | multi line string)
- glibc strlen 实现方式分析
- 【PHP特性-变量覆盖】函数的使用不当、配置不当、代码逻辑漏洞
- Kubernetes - identity and authority authentication
- Redis source code analysis: redis cluster
- [summary of two registration methods]
- Share the newly released web application development framework based on blazor Technology
- Excuse me, my request is a condition update, but it is blocked in the buffer. In this case, can I only flush the cache every time?
猜你喜欢
[positioning in JS]
Redis之Jedis如何使用
[groovy] loop control (number injection function implements loop | times function | upto function | downto function | step function | closure can be written outside as the final parameter)
postman和postman interceptor的安装
【web審計-源碼泄露】獲取源碼方法,利用工具
Basic knowledge of tuples
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
Clickhouse materialized view
An elegant program for Euclid‘s algorithm
【web审计-源码泄露】获取源码方法,利用工具
随机推荐
面试汇总:这是一份全面&详细的Android面试指南
Unity implements the code of the attacked white flash (including shader)
About MySQL database connection exceptions
汇编-入门
How rem is used
UI自動化測試從此告別手動下載瀏覽器驅動
[punch in questions] integrated daily 5-question sharing (phase III)
[Chongqing Guangdong education] 2777t green space planning reference questions of National Open University in autumn 2018
DMX parameter exploration of grandma2 onpc 3.1.2.5
Redis source code analysis: redis cluster
[wp][introduction] brush weak type questions
英语必备词汇3400
Deflocculant aminoiodotide eye drops
程序员的视力怎么样? | 每日趣闻
An elegant program for Euclid‘s algorithm
DECLARE_ WAIT_ QUEUE_ HEAD、wake_ up_ Interruptible macro analysis
IronXL for .NET 2022.6
v-if VS v-show 2.0
Quick start of UI component development of phantom engine [umg/slate]
[安洵杯 2019]不是文件上传