473,320 Members | 1,848 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,320 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 1576
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.