Excerpt from-it Enterprise must read 200. NET face Questions-09. NET database development in

Source: Internet
Author: User
Tags connection pooling
Ado. NET and database connections

Q: Please briefly describe the mechanism of database connection pooling

A database connection pool is a buffer pool that stores database connections. Ado. NET provides the database connection pool service to the upper-level user, and the database connection that is used is selected to remain in the database connection pool for the next use. When a user requests a connection string for a database connection, the database connection pool tries to find a connection in the pool that has the same connection string and provides it directly to the user.

Q: How to increase the reuse rate of connections within a connection pool

In order to improve the reuse rate of database connection pool, the only way is to ensure that the connection string used by the system to access the database is the same. For example, unified use of the Superuser account can further unify the connection string, but this poses a security risk to the system.

What is the role of q:commandbehavior.closeconnection

commandbehavior.closeconnection resolves a situation in which the database connection cannot be closed effectively in streaming read data mode. When a Xxxdatareader object is built with CommandBehavior.CloseConnection, the database connection is automatically closed when the Xxxdatareader object is closed.

Using the ADO read and write database

Q:ado. NET supports which two methods to access the relational database

Connected and offline. The connection is suitable for large data volumes, and the offline type is suitable for small data volume reading operations.

Excerpt from-it Enterprise must read 200. NET face Questions-09. NET database development in

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.