473,396 Members | 2,013 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,396 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 2610
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.