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

Why don't processes go away?

I have a c# application where I run a query every 10
seconds.

After the query completes, I close the connection object,
close the oledbdatareader object and dispose of the
command object.

When I look at my current activity in the database,
sleeping processes keep accumulating for each of these
queries. Why don't they go away? Should I care? Are
they using up any resources?

This application runs on MSDE (latest version).

Thanks for any help.

Bruce

Jul 21 '05 #1
2 1581
Ian
Hi,

Opening and closing connections is expensive - OLEDB will pool connections
by default to mitigate this.

When you close the connection it gets returned to a connection pool. When
you open another connection it gets taken from the pool, assuming that
you're using an identical connection string. This is much faster than
actually opening a port, communicating with SQL Server and setting up a
brand new connection. On the other hand, if you don't open a connection for
a while then idle connections from the pool will actually get destroyed. At
this point they will disappear from SQL Server.

HTH

Ian

"Bruce Sandell" <br***@conferserv.com> wrote in message
news:11*****************************@phx.gbl...
I have a c# application where I run a query every 10
seconds.

After the query completes, I close the connection object,
close the oledbdatareader object and dispose of the
command object.

When I look at my current activity in the database,
sleeping processes keep accumulating for each of these
queries. Why don't they go away? Should I care? Are
they using up any resources?

This application runs on MSDE (latest version).

Thanks for any help.

Bruce

Jul 21 '05 #2
Hi Ian,

Thanks for the info, but I'm still a little confused. If
the connections are being pooled and reused, then why are
there so many processes showing up in SQL Server?
Shouldn't it just keep reusing the same connection? I am
using the same connection string every time. Does it have
to do with it being a web-based application? I have one
person using the application at the moment, and still have
267 processes showing up in the current activity list,
most for the same query.

Thanks,
Bruce
-----Original Message-----
Hi,

Opening and closing connections is expensive - OLEDB will pool connectionsby default to mitigate this.

When you close the connection it gets returned to a connection pool. Whenyou open another connection it gets taken from the pool, assuming thatyou're using an identical connection string. This is much faster thanactually opening a port, communicating with SQL Server and setting up abrand new connection. On the other hand, if you don't open a connection fora while then idle connections from the pool will actually get destroyed. Atthis point they will disappear from SQL Server.

HTH

Ian

"Bruce Sandell" <br***@conferserv.com> wrote in message
news:11*****************************@phx.gbl...
I have a c# application where I run a query every 10
seconds.

After the query completes, I close the connection object, close the oledbdatareader object and dispose of the
command object.

When I look at my current activity in the database,
sleeping processes keep accumulating for each of these
queries. Why don't they go away? Should I care? Are
they using up any resources?

This application runs on MSDE (latest version).

Thanks for any help.

Bruce

.

Jul 21 '05 #3

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

Similar topics

2
by: murray_shane56 | last post by:
We currently have a routine that "forks" out (to use the unix term)TSQL commands to run asynchronously via SQL Agent jobs. Each TSQL command gets its own Job, and the job starts immediately after...
4
by: Evan Smith | last post by:
We're in the process of upgrading to version 8.2 from 7.2 (with hopes that most of the issues we're currently facing will be fixed...). In the interim, we have a new problem that has surfaced that...
15
by: Dirk Reske | last post by:
Hello, why doesn't this code work correctly? private int GetCpuUsage(Process proc) { DateTime time1,time2; TimeSpan timediff; double cpu1,cpu2,cpudiff;
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
4
by: AN | last post by:
Greetings, We make an ASP.NET web application and we host it for our customers. We have provisioned hardware and hope to be able to service around 200 customers on this hardware. The web...
2
by: Bruce Sandell | last post by:
I have a c# application where I run a query every 10 seconds. After the query completes, I close the connection object, close the oledbdatareader object and dispose of the command object. ...
35
by: Carl J. Van Arsdall | last post by:
Alright, based a on discussion on this mailing list, I've started to wonder, why use threads vs processes. So, If I have a system that has a large area of shared memory, which would be better? ...
13
by: Godzilla | last post by:
Hello, How do you create/spawn new processes in XP over telnet using python? I.e. I would like to create a new process and have it running in the background... when I terminate the telnet...
4
by: Bill Nguyen | last post by:
I ran into this problem in a Terminal Server environment When trying to kill all processes having the same name (to avoid hanging instances of this process), my users ran into permission problem...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?

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.