当前位置:网站首页>@transactional滥用导致数据源连接池耗尽问题
@transactional滥用导致数据源连接池耗尽问题
2022-07-04 18:32:00 【*๛ก(ー̀ωー́ก) 】
进入hmp后悔先进入总览的观测图,该页面每一分钟会访问20+个接口,durid、oracle等数据库,且后端访问中都增加了@Transactional的注解(这个注解对接口增加一个事务,每次访问前都会先获取mysql的连接池,只有当接口返回是才会释放),因接口的查询耗时过长且访问频繁,易把连接池占满,导致其他用户无法访问mysql数据库。
@override
@transactional
public Map<String,Object> getAcMap(Map<String,String> map) throws ParseException {
.....
}
@transactional使用要点:
1.以下情况不需加@transactional注解
(1)不是对数据库进行操作的接口
(2)只是对数据库进行查询的接口
(3)对数据库操作耗时较长的接口
2.同一个数据库的查询功能尽量合并在一个接口中完成
边栏推荐
- 性能优化之关键渲染路径
- 测试工程师如何“攻城”(上)
- Technology sharing | interface testing value and system
- FPGA时序约束分享01_四大步骤简述
- 2022CoCa: Contrastive Captioners are Image-Text Fountion Models
- Introduction to polyfit software
- Oracle with as ORA-00903: invalid table name 多表报错
- The CDC of sqlserver can read the data for the first time, but it can't read the data after adding, deleting and modifying. What's the reason
- OpenCV的二值化处理函数threshold()详解
- 1003 Emergency(25 分)(PAT甲级)
猜你喜欢

PolyFit软件介绍

如何使用Async-Awati异步任務處理代替BackgroundWorker?
![[uniapp] uniapp development app online Preview PDF file](/img/11/d640338c626249057f7ad616b55c4f.png)
[uniapp] uniapp development app online Preview PDF file

Oracle with as ORA-00903: invalid table name 多表报错

Online sql to excel (xls/xlsx) tool

Go微服务(二)——Protobuf详细入门

与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用

Detailed explanation of the binary processing function threshold() of opencv

如何使用Async-Awati异步任务处理代替BackgroundWorker?

Go microservice (II) - detailed introduction to protobuf
随机推荐
The 15th youth informatics competition in Shushan District in 2019
长城证券开户安全吗 买股票怎么开户
Online sql to excel (xls/xlsx) tool
Specify the character set to output
添加命名空间声明
1672. Total assets of the richest customers
矩阵翻转(数组模拟)
Shell 编程核心技术《四》
如何使用Async-Awati异步任務處理代替BackgroundWorker?
Generate XML elements
LeetCode 赎金信 C#解答
Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading
26. Delete the duplicate item C solution in the ordered array
函数式接口
OpenCV的二值化处理函数threshold()详解
Go microservice (II) - detailed introduction to protobuf
HDU 1097 A hard puzzle
Stream stream
有关架构设计的个人思考(本文后续不断修改更新)
The CDC of sqlserver can read the data for the first time, but it can't read the data after adding, deleting and modifying. What's the reason