473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Connection Pooling

Hi,
I have a very basic question regarding the connection pooling.

To use the built in connection pooling, do I have to have a connection
object created in some shared class?
Right now, I have a data access class created and disposed each time
database query is made(connection is created and closed in this class)

Any suggestions appreciated

John
Nov 22 '05 #1
5 2607
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Read tip 3, article pertains mostly to ASP.net but I believe most of the ADO
tips hold true for winforms as well.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Miss" <Mi**@Somewhere.com> wrote in message
news:eP**************@TK2MSFTNGP15.phx.gbl...
Hi,
I have a very basic question regarding the connection pooling.

To use the built in connection pooling, do I have to have a connection
object created in some shared class?
Right now, I have a data access class created and disposed each time
database query is made(connection is created and closed in this class)

Any suggestions appreciated

John

Nov 22 '05 #2
Thanks Wayne for the info,

But my question remains the same

I have a remoted object in the middle tier and they access the database thru
the data access class. This class constructed and destroyed for each call.
To use the connection pool does this connection object has to be a shared
object?

Thanks
"Wayne" <Me******@community.nospam> wrote in message
news:O3**************@TK2MSFTNGP14.phx.gbl...
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Read tip 3, article pertains mostly to ASP.net but I believe most of the
ADO
tips hold true for winforms as well.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute.
But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Miss" <Mi**@Somewhere.com> wrote in message
news:eP**************@TK2MSFTNGP15.phx.gbl...
Hi,
I have a very basic question regarding the connection pooling.

To use the built in connection pooling, do I have to have a connection
object created in some shared class?
Right now, I have a data access class created and disposed each time
database query is made(connection is created and closed in this class)

Any suggestions appreciated

John


Nov 22 '05 #3
I believe you are ok as long as you follow the rules in tip 3. However, if
the middle tier is unloaded I think you lose the connection pooling.
Hopefully someone else will have a more certain answer for you.

Wayne

"Miss" <Mi**@Somewhere.com> wrote in message
news:#U**************@TK2MSFTNGP14.phx.gbl...
Thanks Wayne for the info,

But my question remains the same

I have a remoted object in the middle tier and they access the database thru the data access class. This class constructed and destroyed for each call.
To use the connection pool does this connection object has to be a shared
object?

Thanks
"Wayne" <Me******@community.nospam> wrote in message
news:O3**************@TK2MSFTNGP14.phx.gbl...
http://msdn.microsoft.com/msdnmag/is...e/default.aspx
Read tip 3, article pertains mostly to ASP.net but I believe most of the
ADO
tips hold true for winforms as well.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute.
But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Miss" <Mi**@Somewhere.com> wrote in message
news:eP**************@TK2MSFTNGP15.phx.gbl...
Hi,
I have a very basic question regarding the connection pooling.

To use the built in connection pooling, do I have to have a connection
object created in some shared class?
Right now, I have a data access class created and disposed each time
database query is made(connection is created and closed in this class)

Any suggestions appreciated

John



Nov 22 '05 #4
You class does not need to be shared (im assuming you are using
VB.Net). The connection pooling behavior depends on the provider you
are using. For example, if you are using SqlConnection to connect to
the database, the SqlConnection automatically manages pooling.

The first time you open a connection it will create a pool with the
connection string you passed. Then subsequent call will first check to
see if a connection already exists an is available in the pool. If yes
it will use that connection, otherwise it will create a completely new
connection and add that to the pool. This way even if your class is
destroyed your connection pool doesnt untill the process exits.

To take advantage of this though, be sure to use the same connection
string. The slightest variation in the string (even casing) can cause
the connection to create a completely different connection pool.

NuTcAsE

Nov 22 '05 #5
Thank you very much.

I just confirmed what you wrote(from the sql server current processes).

I was worried that since I am destroying my class the connecting might get
lost.

But its working as both of you suggested.

Thanks again!

But the connection pooling works outside the d
"NuTcAsE" <ra********@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
You class does not need to be shared (im assuming you are using
VB.Net). The connection pooling behavior depends on the provider you
are using. For example, if you are using SqlConnection to connect to
the database, the SqlConnection automatically manages pooling.

The first time you open a connection it will create a pool with the
connection string you passed. Then subsequent call will first check to
see if a connection already exists an is available in the pool. If yes
it will use that connection, otherwise it will create a completely new
connection and add that to the pool. This way even if your class is
destroyed your connection pool doesnt untill the process exits.

To take advantage of this though, be sure to use the same connection
string. The slightest variation in the string (even casing) can cause
the connection to create a completely different connection pool.

NuTcAsE

Nov 22 '05 #6

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

Similar topics

18
by: Rob Nicholson | last post by:
We're getting an occasional occurrence of the following error when two users try and open the same record in our ASP.NET app: "There is already an open DataReader associated with this Connection...
1
by: Lenny Shprekher | last post by:
Hi, I am getting issues that Oracle collecting opened sessions (connections) from my webservice using regular System.Data.OleDb.OleDbConnection object. I am guessing that this is connection...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
3
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.