Oracle:oledb Resource (session) pooling
by Eric Ma EMa@ompus.jnj.com
Database connectivity is a prerequisite to today's dynamically generated Web pages. However, connection to databases are one of the most expensive operations one does from within an ASP page, because of the Overhead involved in database user authentication and allocation of the database, handle user interaction with the Database, among other things. All this can add significant latency to your Web site. Based on the "recent discussions in" This list, it is apparent ' everyone is keenly aware of ' this issue and would Minimize the negative impact on performance by have to connect to databases. For a programmer with a client/server programming background, it are natural for the person to design a solution based on U Sing a database connection that persists through a entire user session. However, for a web-based application, this is a big no-no ("the article at/advice/dbsessionapp.asp for reasons why Yo U should never do this).
The best practice for database connection (we limit my discussion to Oracle) from a ASP application is to open the Connection at late as can, and close it as soon as you can, which means your open and close database connection on ever Y ASP page. The encouraged practice is to use just one set of Oracle Username/password for your entire application, not one set for EA CH user as you are used to does with client/server applications. Access control are no longer performed by the database, but by your application. You can save the ADO connection string in a application variable in the Global.asa file. Some other alternatives include saving it in the Windows Registry, or use a include file that has the ADO connection info Rmation, and include that file in the pages where database connection is required.
Opening a new database connection for each ASP page may is as bad as you do, because from ADO 2.0 up can Utiliz E the "resource" pooling "feature offered by Microsoft's OLE DB Provider for Oracle. Resource pooling is similar to ODBC connection pooling, where a connection was returned to a pool instead of being D immediately after it are closed and set to nothing in your code. The following article for more details:
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.