473,409 Members | 1,935 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,409 software developers and data experts.

ASP.NET 2.0, Enterprise Library 2006 and SQL 7 connection problems

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 maxing out the number of connections
allowed to the sql server 7 server after running a few large queries through
the application? There are less than 1000 rows of data in the database and we
are at a loss as to how to fix this, does anyone have any ideas?

Thanks in advance

Andy
Jul 3 '06 #1
7 1889
Hi Andy,

Welcome to the ASPNET newsgroup.

From your description, I understand you're developing an ASP.NET 2.0 web
application which use the enterprise library 2.0 (the data application
block) to connect a sqlserver 7.0 database. However, you found that the sql
server is suffering a connection booming issue when the ASP.NET application
running, correct? If anything I missed , please feel free to correct me.

As for the ADO.NET data accessing, the underlying database connections are
generally managed by the specific data access provider. For your scenario,
I think you're using the sqlserver provider(.net managed provider)
,correct? Also, since you're using data application block in the enterprise
library, all the ADO.NET connection management pattern are done by the
application block, it should not suffer any obvious connection leak issue.
Anyway, for basic troubleshooting, we can first isolate the problem
scenario and here are something we can check first:

1. what's the connection string (use sql or windows authentication), for
sqlserver provider, when the connection pool is based on connectionstring,
when using sql quthentication(embeded username/password in
connectionstring) the connection pool's has best effiency. When using
windows authentication, it will use subpools (according to different login
user). You can check your one and verify whether the issue is specific to a
certain authentication type.

2. whether the issue is data applcationblock (entlib). for testing, you can
try locate the code period which will result the connection booming and
them use pure ADO.NET code(without using enterprise library) to see whether
the problem is specific to entlib.

3. use sql profiler to trace teh connection states at sqlserver side.
For monitoring the connection behavior at sqlserver side(if you have the
sufficient privillege), sql profiler is a good tool to trace the connection
or execution operations.

Hope this helps some. If there is any other findings, please feel free to
post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Jul 4 '06 #2
Hi Steven,

Thanks for your help. Here is a sample of the code we use to call the
enterprise library, followed by our connection string. I'll try your
suggestions, please advise of anything else you think of.

Code
------
//Use the Enterprise Library DatabaseFactory to fetch the BCP
Database db = DatabaseFactory.CreateDatabase();

//Scope the DataReader so it will be disposed after the read
is complete
using (IDataReader reader = db.ExecuteReader("FetchSetBCP",
this.BCPID, this.CCMID,

this.ChangeTypeID,this.DateCompleted,this.Title,th is.RequiredDate,this.AreaID,

this.ChangeDescription,this.BenefitDescription,thi s.TotalAnualBenefit,
this.CategoryID, this.AlreadyDiscussed,
this.HeatRef, this.DateSubmitted, this.BCPReference,
this.BenefitOwner,this.Confidential,this.RejectNot es,
this.NonFinancialBenefits,this.CompletedBy))
{
List<BCPlist = new List<BCP>();

while (reader.Read())
{
BCP bcp = new BCP();

//fill the BCP properties
fillProperties(reader, bcp);

list.Add(bcp);
}
return list;
}

end code
----------

connection string
-------------------
<add name="CCM" connectionString="Data Source=SQLCAR002;Initial
Catalog=CCM;User Id=CCMDBUser;password=password; pooling=false;"
providerName="System.Data.SqlClient"/>

Thanks,

Andy

"Steven Cheng[MSFT]" wrote:
Hi Andy,

Welcome to the ASPNET newsgroup.

From your description, I understand you're developing an ASP.NET 2.0 web
application which use the enterprise library 2.0 (the data application
block) to connect a sqlserver 7.0 database. However, you found that the sql
server is suffering a connection booming issue when the ASP.NET application
running, correct? If anything I missed , please feel free to correct me.

As for the ADO.NET data accessing, the underlying database connections are
generally managed by the specific data access provider. For your scenario,
I think you're using the sqlserver provider(.net managed provider)
,correct? Also, since you're using data application block in the enterprise
library, all the ADO.NET connection management pattern are done by the
application block, it should not suffer any obvious connection leak issue.
Anyway, for basic troubleshooting, we can first isolate the problem
scenario and here are something we can check first:

1. what's the connection string (use sql or windows authentication), for
sqlserver provider, when the connection pool is based on connectionstring,
when using sql quthentication(embeded username/password in
connectionstring) the connection pool's has best effiency. When using
windows authentication, it will use subpools (according to different login
user). You can check your one and verify whether the issue is specific to a
certain authentication type.

2. whether the issue is data applcationblock (entlib). for testing, you can
try locate the code period which will result the connection booming and
them use pure ADO.NET code(without using enterprise library) to see whether
the problem is specific to entlib.

3. use sql profiler to trace teh connection states at sqlserver side.
For monitoring the connection behavior at sqlserver side(if you have the
sufficient privillege), sql profiler is a good tool to trace the connection
or execution operations.

Hope this helps some. If there is any other findings, please feel free to
post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Jul 4 '06 #3
Thanks for your response Andy,

From the code snippet you provided, the code logic is correct and there is
no particular code problem here. And you've put datareader in using ()
block which may ensure the datareader be disposed. Also, the Enterprise
library/Data App block will also ensure that connection be closed after
reader be closed(in the ExecuteReader method). So I don't think this is a
entlib specific issue, but to verify this you can still use some standard
ADO.NET code(without using entlib) to perform the query from the sqlserver
database to see whether it still suffer the issue.

Also, make sure to perform some sql profiler trace at the sqlserver
server-side to see the actual connection open/close behavior when it
suffers the problem.

In addition, from the connectionstring you provided, the connection pooling
ins turned off, have you tried turn it on to see whether the behavior has
any difference?

=========
<add name="CCM" connectionString="Data Source=SQLCAR002;Initial
Catalog=CCM;User Id=CCMDBUser;password=password; pooling=false;"
providerName="System.Data.SqlClient"/>
=========

Thanks & Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 5 '06 #4
Hi Steven,

Thanks for the peer check! i appreciate it, and for your suggestion, we 'll
have a look at that.

I thought i should bring you up to speed on some of our own testing that we
have done. We have connected the application to a SQL 2000 version of the
database and can't seem to get the error, could it be a SQL 7 and .NET 2.0
issue?

We have also raised a Premier Support incident (SRQ060704601731) here in the
UK, i don't know if you can liase with the people helping us or not, we have
not had anything really useful back yet though.

Thanks,

Andy
"Steven Cheng[MSFT]" wrote:
Thanks for your response Andy,

From the code snippet you provided, the code logic is correct and there is
no particular code problem here. And you've put datareader in using ()
block which may ensure the datareader be disposed. Also, the Enterprise
library/Data App block will also ensure that connection be closed after
reader be closed(in the ExecuteReader method). So I don't think this is a
entlib specific issue, but to verify this you can still use some standard
ADO.NET code(without using entlib) to perform the query from the sqlserver
database to see whether it still suffer the issue.

Also, make sure to perform some sql profiler trace at the sqlserver
server-side to see the actual connection open/close behavior when it
suffers the problem.

In addition, from the connectionstring you provided, the connection pooling
ins turned off, have you tried turn it on to see whether the behavior has
any difference?

=========
<add name="CCM" connectionString="Data Source=SQLCAR002;Initial
Catalog=CCM;User Id=CCMDBUser;password=password; pooling=false;"
providerName="System.Data.SqlClient"/>
=========

Thanks & Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 5 '06 #5
Thanks for your followup Andy,
We have connected the application to a SQL 2000 version of the
database and can't seem to get the error, could it be a SQL 7 and .NET 2.0
issue?
=======================
Yes, actually this is the first thing I've tried checking in our internal
case library and I didn't find any known issue of connecting SQL Server 7.0
with .net framework.
We have also raised a Premier Support incident (SRQ060704601731) here in
the
UK, i don't know if you can liase with the people helping us or not, we
have
not had anything really useful back yet though.
===============================
I think this the most efficient way since the product support engineer will
help you perform some thorough throubleshooting. And I think they'll also
ask you to capture some trace log since this will be important.

So far I haven't any further information about this issue since this is
likely a project specific one. Anyway, if you got any new update from the
product team, please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Jul 6 '06 #6
Hi Steven,

Just thought i'd give you an update. This may be beneficial to other users
here too. Since we moved the application database from SQL Server 7.0 to SQL
Server 2000 the problem has not occured. We believe that there are issues
with ASP.NET 2.0/ADO.NET 2.0/Enterprise Library 2006 and SQL Server 7.0.

The application also runs much quicker. Just thought i should let you know.

Andy

"Steven Cheng[MSFT]" wrote:
Thanks for your followup Andy,
We have connected the application to a SQL 2000 version of the
database and can't seem to get the error, could it be a SQL 7 and .NET 2.0
issue?
=======================
Yes, actually this is the first thing I've tried checking in our internal
case library and I didn't find any known issue of connecting SQL Server 7.0
with .net framework.
We have also raised a Premier Support incident (SRQ060704601731) here in
the
UK, i don't know if you can liase with the people helping us or not, we
have
not had anything really useful back yet though.
===============================
I think this the most efficient way since the product support engineer will
help you perform some thorough throubleshooting. And I think they'll also
ask you to capture some trace log since this will be important.

So far I haven't any further information about this issue since this is
likely a project specific one. Anyway, if you got any new update from the
product team, please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Aug 1 '06 #7
Hi Andy,

Thanks for your followup and the updated information. It is really
appreciated and will benifit other community member who encountering the
similar problem.

Have a good day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Aug 2 '06 #8

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

Similar topics

1
by: Mike Chamberlain | last post by:
Hi all. I'm trying to extend the Microsoft Enterprise Library Data Access Application Block (http://msdn.microsoft.com/library/en-us/dnpag2/html/daab.asp?frame=true) to work with a Borland...
0
by: Chris Crowe [MVP 1997 -> 2006] | last post by:
I am having major problems using GetStoredProcCommand and using Parameters in the same function call in the latest builds of the Enterprise Library Data. The error I get is : Failed to...
1
by: Eduard Ralph | last post by:
Hi, I've been having a very weird problem in connection with using the Enterprise Library. I'm programming a Windows Service and utilise the logging and configuration component. During the...
7
by: rockdale | last post by:
hi, I just downloaded Microsoft Enterprise Library Jan 2006 and try to integrate it into my asp.net application. As i am going to connect to mySQL database, I need to include the source code in my...
0
by: Chris Dunaway | last post by:
Enterprise Library January 2006 Visual Studio 2005 Lanugage: C# I am attempting to use the Enterprise Library to read data from an Excel spreadsheet file. I got the following connection...
1
by: dirk.dircksen | last post by:
Hi I'm busy migrating code from the June 2005 Enterprise Library edition to the January 2006 edition. One of the cool things about the June 2005 edition (for me, in any case) was the fact that...
1
by: Victor | last post by:
Hi guys I have a question here. I am currently using Enterprise Library Jan 2006 version. I found out where i execute the Database.executeDataSet() the Enterprise Library will not close the...
2
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I am trying to add multiple connection strings in my web.config file. I searched in google to find out how to add multiple connections strings through enterprise library 2.0 ,...
1
by: GaryDean | last post by:
I now have installed (from the same install) Enterprise Library - January 2006 and Enterprise Library - June 2005. The install for these two was called Enterprise Library for .Net 2.0. (not...
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:
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.