473,656 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Usage of Connection Pooling: What are the best practices?

Hello All,

I am working on a windows application which will talk to the database

through the Web services.

So i need to enhaance the performance, for which i m using connection

pooling.

I want to use pooling at the Web services end and not the default SQL server

pooling.

i have created a connection pool component which maintains a pool of

sqlconnection objects.

When a request for connection comes:

1. It checks the pool for open connection which are not currently in use. If

it finds one it returns it.

2. Else it creates a new connection object , opens it and adds it to the

pool.

Now my problem is that if i plan to ve a pool of 100

connections.... ........if at some instant i ve 100 requests i ll return all

the avaialable connection objects

But this scenario was an exterme one and in most cases not more than 50

connections will be in use. So in that case i need to close the open

connection if it is unused for a given amount of time.

For that i created a thread which keeps checking if any of the connection

object timed out and if it has timed out then close it.

Will this approach be useful performance wise??

Will an extra thread running affect the applications perforamance??

Is there any other solution to this??

Is application level pooling needed in my application and will it help

improve the performance??

Please reply ASAP.

Regards,

Mithun
Jul 21 '05 #1
1 2826
It's recommended that you make use of the SqlProvider connection pool which
is included in the .NET Framework. This has undergone extensive performance
and scalability testing and it is unlikely a custom implementation of a
connection pool would see significant improvements in these areas.

FYI in order to leverage the built-in connection pool you need to always use
the same connection string - this implies the same user account is used to
authenticate against the database. Check out this link:
http://msdn.microsoft.com/library/de...taProvider.asp

--
Provided by the Microsoft PSfD UK team.
This posting is provided "AS IS" with no warranties, and confers no rights.

"Mithun Verma" <mi*****@MAQSof tware.com> wrote in message
news:O6******** **********@TK2M SFTNGP10.phx.gb l...
Hello All,

I am working on a windows application which will talk to the database

through the Web services.

So i need to enhaance the performance, for which i m using connection

pooling.

I want to use pooling at the Web services end and not the default SQL server
pooling.

i have created a connection pool component which maintains a pool of

sqlconnection objects.

When a request for connection comes:

1. It checks the pool for open connection which are not currently in use. If
it finds one it returns it.

2. Else it creates a new connection object , opens it and adds it to the

pool.

Now my problem is that if i plan to ve a pool of 100

connections.... ........if at some instant i ve 100 requests i ll return all
the avaialable connection objects

But this scenario was an exterme one and in most cases not more than 50

connections will be in use. So in that case i need to close the open

connection if it is unused for a given amount of time.

For that i created a thread which keeps checking if any of the connection

object timed out and if it has timed out then close it.

Will this approach be useful performance wise??

Will an extra thread running affect the applications perforamance??

Is there any other solution to this??

Is application level pooling needed in my application and will it help

improve the performance??

Please reply ASAP.

Regards,

Mithun

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2756
by: Mark | last post by:
OK. Here we go. I have an ASP.NET application that does many hits to a SQL Server DB on a separate server. When I first created this application (2 years ago) and was very new to ASP/ASP.NET, to make the SQL connection string global throughout the application I created a .vb file within the application project and declared a public SQLConnection: Public ors_wnf As SqlConnection = New...
7
2258
by: greg | last post by:
Hi We have w2k, iis5, .NET/c# I periodically receive this message and the system freezes ++++++++++++++++++++++++++++++++++++++++++++++++++ Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in
1
400
by: Mithun Verma | last post by:
Hello All, I am working on a windows application which will talk to the database through the Web services. So i need to enhaance the performance, for which i m using connection
2
1606
by: PH | last post by:
Hi; I got an application written in ASP.NET (VB.NET and C#) that uses connection pooling. The Max connections defined in the connection command are 50, and there are no more than 3 or 4 user using the application (intranet). I very carefully open the connections in the LOAD event and close them in the PreRender event. Usually I got only one connection opened per FORM.
3
10287
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database I use System.Data.Common.DBConnection and .DBCommand. How can I keep aware from connection losses (network not availeable, db-server not available...)? Are there any strategies to detect this broken connections, and how can I
4
6372
by: =?Utf-8?B?RFNJU3VwcG9ydA==?= | last post by:
Hi, I have this ASP.NET application developed with VS.NET 2003 VB.NET and deplyed on Windows 2K server IIS 5. This application uses the following: - Oracle 10G databse - MS Data Access Block from MS Enterprise Library June 2005 (with the other blocks like exception, security...) - Use Crystal Report Components for printing reports online And everything was fine until recenntly we started getting this error randomly and the only way to...
6
2996
by: Charles Zhang | last post by:
I want to reuse ADO.NET Connection object from session to session, are there any way to do that? Thanks Charles Zhang
3
4885
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable g_sConnectionString and leave this connection open and not close it until it exits the application. Then on each thread/each subsequent sub that needs the connection I create a local OleDBConnection variable, open the connection using the exact...
0
6599
viswarajan
by: viswarajan | last post by:
Introduction This article is to go in deep in dome key features in the ADO.NET 2 which was shipped with VS 2005. In this article I will go trough one of the key features which is the Connection Pooling. This feature is a key feature plays an important role in the performance in most of business application or Data driven application. What's Connection Pooling?
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8717
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7311
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.