In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to test ADO connection pool". In daily operation, I believe many people have doubts about how to test ADO connection pool. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to test ADO connection pool". Next, please follow the editor to study!
This time, you are not going to test with ADO connection pooling. In the above program, pooing = false indicates that you do not intend to use ADO connection pooling either. Connect the program 10 times through the connection string Open & Close to see if you use a performance counter to observe the number of "physical connections" of SQL Server.
You can see from the jagged figure below that each time con.Open () is executed, the number of "physical connections" of SQLServer increases by one, while the number of "physical connections" of SQLServer decreases with each execution of con.Close (). Because connection pooling is not used, Data Provider needs to destroy "logical connection" and "physical connection" every time Close connects, and Data Provider needs to establish "logical connection" and "physical connection" every time Open connection.
Let's enable connection pooling to test again. Change the pooling parameter of the connection string to true, and add Console.Read () after the for loop.
As can be seen from the following figure, during the period from the * Open to the end of the Console.Read (), the number of "physical connections" of the SQL Server remained at 1, and the number of "physical connections" of the SQL Server did not change to 0 until the process of closing the console application. Due to the use of ADO connection pooling, Data Provider only needs to release the "logical connection" back to the ADO connection pool each time the Close connection is made, while the corresponding "physical connection" remains open. Each time Open connects, Data Provider only needs to take a "logical connection" from the connection pool, so that it can use its corresponding "physical connection" without establishing a new "physical connection". As a result, the line chart is formed.
At this point, the study on "how to test ADO connection pool" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.