473,804 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connection pooling for internet apps?

I wanted to post this on the SQL newsgroup, but I get a 'page not found' when
trying to go to that newsgroup. Since it is a C# app, I'll try it here.

I have a C# web application (.NET 1.1). I multi-thread requests to 10
different tables (full text indexed tables) on the same database. These are
done concurrently, not consecutively. In order to get this to work, I have
to open 10 connections to the database. According to the documentation,
pooling is on by default. I get some sporadic errors that make me think that
connection pooling may not be working correctly, or perhaps there is a bug in
connection pooling. For example, I occasionally get an error indicating that
the specified connection is in use. I get a stack dump when this happens,
but it happens in seemingly random locations in my code. I can never
recreate the problem, because when I try to recreate it, it works fine. I
just can't figure out why the code works 99% of the time, but 1% of the time
it will tell me the connection is in use. Other times I get an error saying
that a specified column does not exist in the collection (on sql readers
specifically), even though I know it does. Again, when trying to recreate
the error, it works perfectly. It would appear to be some type of corruption
in the connection, that is the only thing that really makes sense.
Dec 28 '05 #1
5 1468
KJ
I too have experienced the seemingly random "connection is in use"
error, and was unable to solve it, except to serialize the database
calls (which is not necessarily a bad idea on a single-processor
machine). Of course, you can turn connection pooling off in the
connection string if need be (Pooling=false) to see if there is a
difference. Another thing to investigate is whether all the objects
used to connect and execute commands are disposed properly.

Hope this helps.

Dec 28 '05 #2

"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:58******** *************** ***********@mic rosoft.com...
I wanted to post this on the SQL newsgroup, but I get a 'page not found'
when
trying to go to that newsgroup. Since it is a C# app, I'll try it here.

I have a C# web application (.NET 1.1). I multi-thread requests to 10
different tables (full text indexed tables) on the same database. These
are
done concurrently, not consecutively. In order to get this to work, I
have
to open 10 connections to the database. According to the documentation,
pooling is on by default. I get some sporadic errors that make me think
that
connection pooling may not be working correctly, or perhaps there is a bug
in
connection pooling. For example, I occasionally get an error indicating
that
the specified connection is in use. I get a stack dump when this happens,
but it happens in seemingly random locations in my code. I can never
recreate the problem, because when I try to recreate it, it works fine. I
just can't figure out why the code works 99% of the time, but 1% of the
time
it will tell me the connection is in use. Other times I get an error
saying
that a specified column does not exist in the collection (on sql readers
specifically), even though I know it does. Again, when trying to recreate
the error, it works perfectly. It would appear to be some type of
corruption
in the connection, that is the only thing that really makes sense.


Where does the SQL server run on? Same machine as client? What OS?
How many concurent connections are there allowed for SQL?

Willy.
Dec 28 '05 #3
I've tried both configurations. Originally they were on 2 seperate servers
on the same network segment, same physicial location, just connected through
a switch. I've since moved them to the same machine hoping to eliminate the
problem, but the frequency and seemingly randomness of the problem has not
changed. I am running on Windows Server 2003 Enterprise, SQL Server 2000
SP4. The original configuration had 1 Gig of Ram on each machine. The
current configuration (where they are on the same machine) has 2 Gig of Ram.
This database is not what I would call extremely busy, but that is obviously
relative. We have had 90,000 visitors to our website in 6 months. That's
about 15,000 per month, or 500 per day. To me, that's low to medium usage.

The application DOES beat the heck out of the database. Depending on
options, it starts up to 15 threads all running multi-threaded. About 8 to
10 of the threads will open independent connections to the database. All
connections are opened sequentially at the start of the process, and when all
threads complete, all connections are closed, then disposed.

The method I use for managing my connections is to have a class called
'global'. This class is instantiated at the start of my web request, at
which point all connections are opened. The connection variables are all
defined at the class level as private variables, NOT static variables. This
should keep each web request completely independent of each other, not? I
mean, is it possible that 2 users at the same time could somehow walk over
each other? If the connections were static, then I would think that is a
possibility, but they are not static.

"Willy Denoyette [MVP]" wrote:

"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:58******** *************** ***********@mic rosoft.com...
I wanted to post this on the SQL newsgroup, but I get a 'page not found'
when
trying to go to that newsgroup. Since it is a C# app, I'll try it here.

I have a C# web application (.NET 1.1). I multi-thread requests to 10
different tables (full text indexed tables) on the same database. These
are
done concurrently, not consecutively. In order to get this to work, I
have
to open 10 connections to the database. According to the documentation,
pooling is on by default. I get some sporadic errors that make me think
that
connection pooling may not be working correctly, or perhaps there is a bug
in
connection pooling. For example, I occasionally get an error indicating
that
the specified connection is in use. I get a stack dump when this happens,
but it happens in seemingly random locations in my code. I can never
recreate the problem, because when I try to recreate it, it works fine. I
just can't figure out why the code works 99% of the time, but 1% of the
time
it will tell me the connection is in use. Other times I get an error
saying
that a specified column does not exist in the collection (on sql readers
specifically), even though I know it does. Again, when trying to recreate
the error, it works perfectly. It would appear to be some type of
corruption
in the connection, that is the only thing that really makes sense.


Where does the SQL server run on? Same machine as client? What OS?
How many concurent connections are there allowed for SQL?

Willy.

Dec 29 '05 #4
KJ
When are the connection objects disposed?

Jan 4 '06 #5
I dispose of all objects in the Page_Unload method.

"KJ" wrote:
When are the connection objects disposed?

Jan 6 '06 #6

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

Similar topics

6
7696
by: Jonas Knaus | last post by:
hello until now i allways wrote all my sql-stuff in my presentation-layer. i heard about that model of that presentation- / businesslogic- and data access layer -model. i found some example on the internet, but not very useful. does anyone has some examples for this ??? i would by very happy !!!
4
2770
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 make the SQL connection string global throughout the application I created a .vb file within the application project and declared a public SQLConnection: Public ors_wnf As SqlConnection = New...
2
6826
by: Steve Foo | last post by:
I have been posting this question in google group, EE, and Oracle OTN forum and still no cannot find a suitable solution for it. I have contacted Singapore Microsoft support regarding the problem .Unfortunately they are not able to help me and eventually direct me here i'm not 100% sure if this problem is due to ODP.net provider or asp.net IIS setting Hopefully Microsoft Experts here can help me up. Thx Introduction...
2
2335
by: Vinod | last post by:
All, .NET Web Service needs to talk to third party software through TCP/IP sockets. Do we have any .Net Framework in place which can do a TCP/IP
9
5735
by: Not Me | last post by:
Hi, I'm using asp.net 2 with an sql server 2000 database. What steps if any, must I take to ensure connection pooling efficiently? for any 'manual' connections made, I open the sqlconnection obtaining the connection string from configurationmanager.connectionstrings, and close the connection as soon as it's been finished with. I haven't run any tests yet but just wondered if there's something I
9
2035
by: Tomasz | last post by:
Hello everybody, i'm writing an application, which should be connected all the time to the database. So i want to test it in few ways if reconnection works in order. First thing i tried to do is killing my apps process from MS SQL (2005 Express). Problem is that after i have still "Open" status for SqlConnection.Status. That means, that "Status" property is not enough to test :( I would like to not to test the connection everytime with...
16
2878
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 a worker thread that would execute the db commands. The pool was fixed and all the connections were created when the db access class was instantiated. The connections remained opened during the whole execution. If a connection was not available...
0
6626
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 Pooling. This feature is a key feature plays an important role in the performance in most of business application or Data driven application. What's Connection Pooling?
2
1462
by: Tom | last post by:
I try to do the following: Generate a pooled connection in a web application. I use the following code: In my Global.asax.cs protected void Application_Start(object sender, EventArgs e) { //Creating a global pooled connection object ConnectionStringSettings DBconn =
0
9707
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6856
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.