In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to understand ADO.NET statistics". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to understand ADO.NET statistics".
It takes some time to obtain a connection. In the application of ADO.NET statistics, when a new request arrives, the connection is constantly opened and closed, and ADO.NET statistics processes requests efficiently. In this environment, it is important to have a small load when establishing a connection, and ADO.NET statistics has become a bottleneck of system scalability.
One solution is connection pooling (Connection Pooling). Connection pooling is the setting that keeps database connections shared by the session persistent when using the same data source. This avoids creating and destroying connections all the time. In ADO.NET, connection pooling is completely transparent to programmers, and the data access code does not need to be modified at all. When a customer requests a connection by calling Open (), ADO.NET statistics gets the service directly from the available pool rather than recreating it. When a customer releases a connection by calling Close () or Dispose (), there is no need to discard the connection, but instead returns to the pool to serve the next request.
ADO.NET statistics itself does not include a connection pooling mechanism. However, most ADO.NET providers implement some form of connection pooling. ADO.NET Statistics implements their own efficient connection pooling algorithm. These algorithms are fully implemented in manageable code-in stark contrast to some popular misconceptions-not using COM+ enterprise services. For connections that need to be reused in SQL Server and Orace, the connection strings can match exactly. If slightly different, a new connection is created in the new pool.
Tip: SQL Server and Oracle pools use a plain text algorithm. It means that any slight change in the connection string will hinder connection pooling. ADO.NET statistics shows that connection pooling cannot be used even by simply changing the order of parameters or adding an extra space on the * * surface. It forces you not to hard-code connection strings in Web pages. Instead, you should store the connection string in one place (* * in the section of the web.config file).
With SQL Server and Oracle providers, connection pooling is available and used automatically. However, you can also configure the size of the pool using the connection string parameter. If you use a SQL Server provider, you can use the SqlConnection.RetrieveStatistics () method (which was not available before. Net 2.0) to get some interesting statistics. RetrieveStatistics returns a hash table and different underlying details to help you analyze the performance of commands and the number of tasks performed. Connection statistics are not often used in deployed applications, but are useful for analyzing performance during testing and molding. For example, ADO.NET Statistics provides a tool that you can use to determine how different data access policies are enforced (other tools include SQL Server management tools such as SQL Profiler and Query Analyzer).
By default, connection statistics are disabled to improve performance. In order to use connection statistics, you need to set the SqlConnection.StatisticsEnabled property to true. This tells the SqlConnection class to collect information about each action it performs. After any breakpoint, ADO.NET statistics you can call the RetrieveStatistics () method to check this information, or use ResetStatistics () to clear it and start capturing again.
Thank you for reading, the above is the content of "how to understand ADO.NET statistics". After the study of this article, I believe you have a deeper understanding of how to understand ADO.NET statistics, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.