473,396 Members | 1,693 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 and the data access application block

I was looking at the data access application block version 2 and considering
what I had read about connection pooling in that to use connection pooling
successfully, you should close your sqlconnections as quickly as possible.
The DAAB doesn't seem to close or dispose of connections. Are people using
the DAAB on web applications or maybe have people added to the DAAB to
close/dispose connections?
Nov 16 '05 #1
5 4480
Edward W. wrote:
I was looking at the data access application block version 2 and considering
what I had read about connection pooling in that to use connection pooling
successfully, you should close your sqlconnections as quickly as possible.
The DAAB doesn't seem to close or dispose of connections. Are people using
the DAAB on web applications or maybe have people added to the DAAB to
close/dispose connections?

The DAAB DOES handle connections properly, when its creates the
connection itself (using the methods that take a connection string as a
parameter), and it also allows you to pass in your own connection
object. If you pass in your own connection object, you are required to
handle its opening/closing yourself.

HTH...
Chris
Nov 16 '05 #2
DAAB is a really great framework... the only issue that I had with it
was the lack of a good way to handle transactions, although you can
manually do it with the ExecuteScalar function.

Yes, it does close connections properly.

Lowell

Chris Hyde wrote:
Edward W. wrote:
I was looking at the data access application block version 2 and
considering what I had read about connection pooling in that to use
connection pooling successfully, you should close your sqlconnections
as quickly as possible. The DAAB doesn't seem to close or dispose of
connections. Are people using the DAAB on web applications or maybe
have people added to the DAAB to close/dispose connections?

The DAAB DOES handle connections properly, when its creates the
connection itself (using the methods that take a connection string as a
parameter), and it also allows you to pass in your own connection
object. If you pass in your own connection object, you are required to
handle its opening/closing yourself.

HTH...
Chris

Nov 16 '05 #3
WJ
DAAB handles everything for you efficiently. Using DAAB also reduces bugs. I
always close my own connection, however, I check the state of connection
before closing/opening it.

John

"Edward W." <ed******@aol.comXSPAMMERIHATEYOU> wrote in message
news:OV**************@TK2MSFTNGP09.phx.gbl...
I was looking at the data access application block version 2 and
considering what I had read about connection pooling in that to use
connection pooling successfully, you should close your sqlconnections as
quickly as possible. The DAAB doesn't seem to close or dispose of
connections. Are people using the DAAB on web applications or maybe have
people added to the DAAB to close/dispose connections?

Nov 16 '05 #4
I've been using DAAB since v1 and am currently using v2 and find it to be
very solid. The DAAB allows consumer to pass in a connection or transaction
object to method overloads and it's up to the consumer to close connection
(cleanup in the finally portion of try...catch block to ensure connections
are being disposed of properly).

Consuming code also has access to overloads that take a connection string -
in this instance the DAAB handles opening and closing the connection for you
(in an efficient manner). Also keep in mind that connections are pooled per
unique connection string.

"Edward W." wrote:
I was looking at the data access application block version 2 and considering
what I had read about connection pooling in that to use connection pooling
successfully, you should close your sqlconnections as quickly as possible.
The DAAB doesn't seem to close or dispose of connections. Are people using
the DAAB on web applications or maybe have people added to the DAAB to
close/dispose connections?

Nov 16 '05 #5
DAAB is using "The using statement" which automatically calls Dispose on the
object being "used" when leaving the scope of the using statement.
For example:
//C#

string connString = "Data Source=localhost;Integrated
Security=SSPI;Initial Catalog=Northwind;";
using (SqlConnection conn = new SqlConnection(connString))
{

SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT CustomerId, CompanyName FROM Customers";
conn.Open();
using (SqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
Console.WriteLine("{0}\t{1}", dr.GetString(0),
dr.GetString(1));
}
}
"Edward W." wrote:
I was looking at the data access application block version 2 and considering
what I had read about connection pooling in that to use connection pooling
successfully, you should close your sqlconnections as quickly as possible.
The DAAB doesn't seem to close or dispose of connections. Are people using
the DAAB on web applications or maybe have people added to the DAAB to
close/dispose connections?

Nov 16 '05 #6

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

Similar topics

6
by: Chris Szabo | last post by:
I've created a data access layer for a .NET web application. I'm using C# and framework 1.1. I'm getting an error from time to time when I close a connection saying: ...
4
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...
5
by: Edward W. | last post by:
I was looking at the data access application block version 2 and considering what I had read about connection pooling in that to use connection pooling successfully, you should close your...
7
by: galico | last post by:
Hi All, We are having a very strange problem with the above. We have designed an application in ASP.NET 2.0 that uses the enterprise library data application blocks amongst others. We seem to be...
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...
4
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...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
9
by: fniles | last post by:
I am using VB.NET 2003 and SQL 2005. To use connection pooling and avoid the error "There is already an open DataReader associated with this Connection which must be closed first." , I understand...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.