当前位置:网站首页>@Data source connection pool exhaustion caused by transactional abuse

@Data source connection pool exhaustion caused by transactional abuse

2022-07-04 19:37:00 *๛ก(ー ̀ω ー ́ ก) 

Get into hmp Regret to enter the observation map of the overview first , This page will be visited every minute 20+ Interface ,durid、oracle Such as the database , And back-end access has increased @Transactional Annotations ( This annotation adds a transaction to the interface , Before each visit, you will get mysql The connection pool , Only when the interface returns yes, it will be released ), Because the query of the interface takes too long and is accessed frequently , Easy to fill the connection pool , It makes other users unable to access mysql database .

@override
@transactional
public Map<String,Object> getAcMap(Map<String,String> map) throws ParseException {
    
	.....
}

@transactional Use points :
1. There is no need to add @transactional annotation
(1) It is not an interface to operate the database
(2) It's just an interface for querying the database
(3) Interface that takes a long time to operate the database
2. The query function of the same database should be combined in one interface

原网站

版权声明
本文为[*๛ก(ー ̀ω ー ́ ก) ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041802332148.html