Oracle: OLEDB Resource(Session) Poolingby Eric Ma EMa@ompus.jnj.comDatabase connectivity is a prerequisite for today's dynamically generated web pages. However, connection to databases is 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 database resources to handle user interaction with the database, among other things. All these can add significant latency to your web site. Based on the recent discussions in this list, it is apparent that everyone is keenly aware of this issue and would like to minimize the negative impact on performance by having to connect to databases. For a programmer with a client/server programming background, it is natural for the person to design a solution based on using a database connection that persists through an entire user session. However, for a web-based application, this is a big no-no (see the article at /advice/dbsessionapp.aspfor reasons why you should never do this).The best practice for database connection (we limit our discussion to Oracle here) from an ASP application is to open the connection at late as you can, and close it as soon as you can, which means you open and close database connection on every ASP page. The encouraged practice is to use just one set of Oracle username/password for your entire application, not one set for each user as you may be used to do with client/server applications. Access control is no longer performed by the database, but by your application. You can save the ADO connection string in an application variable in the global.asa file. Some other alternatives include saving it in the windows Registry, or use an include file that has the ADO connection information, and include that file in the pages where database connection is required.Opening a new database connection for each ASP page may not be as bad as you think, because from ADO 2.0 up you can utilize the "resource (session) pooling" feature offered by Microsoft's OLE DB Provider for Oracle. Resource pooling is similar to ODBC connection pooling, where a connection is returned to a pool instead of being destroyed immediately after it is closed and set to nothing in your code. See the following article for more details:
OLEDB Resource(Session) Pooling (在Ado开发中使用连接池)
来源:互联网 发布日期:2016-01-14 11:16:06 浏览:1626次
相关内容
AiLab云推荐
最新资讯
本月热点
热门排行
-
最坏时期已过,美国5G市场即将迎来回暖?
阅读量:47333
-
华为5G-A实现规模组网,下载速度超过4Gbps,比5G快10倍
阅读量:46669
-
回望2023年5G发展:释放和提升价值成最大课题
阅读量:12241
-
全球吹响5G-A商用号角
阅读量:11126
-
5.5G在欧洲突破,DNA首次将5.5G技术引入现网
阅读量:10231
-
首发新款麒麟5G芯片!曝华为nova 12系列12月26日登场
阅读量:10003
推荐内容
- 2024第三十二届中国(深圳)国际礼品及家居用品展览会(深圳礼品展)
- 2024第二十届中国(上海)国际医疗旅游展览会
- 2024年科隆东盟少儿用品展览会 (Kind+Jugen ASEAN 2024)
- 2024中国(太原)国际锂电池技术设备展览会
- 海名·2024第九届西安餐饮供应链博览会
- 2024年盐城风能展
- 2024年中国风电展业大会暨展览会
- 2024第二十三届浙江国际智能楼宇技术与智慧安防产品展览会暨浙江(杭州)国际人工智能,物联网,大数据博览会(杭州智博会)
- 2024年中国郑州食品加工及包装机械展
- IOTE 2024第二十一届中国国际物联网博览会(上海站)
- 2024年日本东京IT展Japan IT Week Spring
- 2024越南国际采矿暨设备技术展览会暨2024越南建筑工程展览会
- 2024年第28届土耳其国际电力及能源展览会 土耳其输配电机电工展览会
- 2024年第28届土耳其国际电力及能源展览会
- 2024第三十二届中国国际电子生产设备暨微电子工业展(NEPCON China)
- 2024第十四届中国西部国际物流产业博览会 第八届中国(西安)智慧交通博览会
- 第四届中国国际数字产品博览会
- 2024年俄罗斯第23届国际石油和天然气工业设备及技术展览会
- 2024年法国巴黎国际工程机械展
- 2024年俄罗斯电力电工及电气工程展览会
- 2024江苏国际工业自动化及智能装配展览会
- 2024石家庄印刷出版博览会
- 2024年第36届俄罗斯国际通信展览会
- 第36届俄罗斯国际通信展(SVIAZ 2024)
- 2024第45届中国(江西)美博会 江西中医养生理疗及大健康博览会
- 2024年德国“汉诺威工业博览会”
- 2024韩国国际机械展