Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: Beginner
Feb 1, 2000

Ensure Efficient Usage of Connections

You should be very careful while establishing database connections from your Web-based application.

MDAC 2.0 (Microsoft Data Access Components) provides automatic connection pooling behind the scenes. Connection pooling in OLE DB is enabled by an OLE DB service component that works with the OLE DB provider that you are using to talk to the database. Whenever you call Open and Close methods on the Connection object, OLE DB internally gets and drops back the connection to a single pool of connections so that it can be reused by other components in the application.

While designing your application, you should always make sure that you acquire resources as late as possible and release them as early as possible. This golden rule applies to database connections as well and your application should acquire connections late and should release them as early as possible.

If you use this approach, your application will perform better while making efficient usage of the resources. I suggest that your middle-tier components should establish and release connections on a per-method basis.

Deepak Pant
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap