jdxia opened a new issue, #35123: URL: https://github.com/apache/shardingsphere/issues/35123
When a SQL is executed at the springboot level, sqlsession will be closed, and will be closed from the spring transaction manager. The spring transaction manager first obtains the connection from threadlocal. Please note this connection (very important) This connection is obtained from the springboot default hikariCP connection pool. Assume that this connection pool is order-pool The maximum of this order-pool is 20, so now total=20, active=1 Then this connection will getConnection from drive. Note that this drive is shardingjdbc Shardingjdbc has a hikariCP connection pool. That is, the connection pool is a connection pool. Okay! Now the question is. What happens when a SQL is executed? The spring transaction manager calls close, which calls springboot's hikariCP. What method is executed at this time? When you debug, you will find that it is the close of hikariCP's ProxyConnection. This close will return the shardingjdbc connection obtained by springboot to springboot's own connection pool The final performance of the two connection pools is > order-pool total=20, active=0,idle=1 > shardingshpere hikariCP-1 total=50, active=1,idle=0 Please write a sql where field in (1,2,3) Involving several sub-databases, and then do a stress test, hikariCP turns on the debug level log to see -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
