-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Processing Time increased after integrated with Spring Framework #631
Comments
Cloud you provide |
Dear kazuki, Thanks for your reply and please find the updated project for the applicationContext.xml. Many thanks. |
@shin779 Thx! I will investigate at later. |
Dear @kazuki43zoo, Thanks for your review! We digged deeper and find that the process times increase when using transation with MyBatis Spring Adapter: https://mybatis.org/spring/transactions.html#programmatic We perform 10000 queries inside a transation and the process time increase higher and higher unless we create another transation (commit / rollback then get a new one) after certain number of queries. We tried to use Spring transation manager without MyBatis and the process time will not increase. Although we can low the process time by switching the We understand there is mechanism and tasks behind MyBatis that may take more time to perform query (proxying, reflect and mapping...etc), but we are wondering if such jobs will make the same query takes more and more time to finish. P.S. We used MyBatis 2.3.5, Mybatis Spring (1.2.2) and Spring 3.2.2 with transation manager in previous project without such issue. Is it related to the changes between SqlSession and SqlMapClient? |
@shin779 Thanks you for your reporting! I've tried using together with DBCP 2.9, this issue has been fixed. Could you use a newer other connection pool implementation instead of JDBC 1.4? This behavior did not occur using together with |
Dear @kazuki43zoo Thanks for the testing! We replace DBCP with DBCP2 2.9 and it works like a charm! There is serval improvement in DBCP2 including the upgrade of common pooling, and common-pool2 seems have a better implementation in object pooling and we wondering if it is related to our issue. Just like you measured and it seems works fine when using Thanks again for your work and wish you a happy new year. |
MyBatis version
3.5.2 - 3.5.8
MyBatis Spring Adapter version
2.0.1 - 2.0.5
Database vendor and version
H2 1.4.200
IBM DB2 10.5 LUW
Test case or example project
https://github.com/shin779/DBTestMyBatisSpringWithTxMgr
Steps to reproduce
Perform simple select query (e.g.
select 1 from dual
) in a massive number (e.g. 10000 times) inside a transation which managed by Spring via mybatis-springExpected result
The process time of 1st 1000 queries should similar to 2, 3...nth 1000 queries
(e.g. if 1st to 1000th queries takes 5sec, then 5001th to 6000th should take ~5 sec as well)
Actual result
Process time keep increase in direct proportion unless keep commit / rollbak with certain number:
The text was updated successfully, but these errors were encountered: