By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,471 Members | 711 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,471 IT Pros & Developers. It's quick & easy.

Connection Pooling

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.