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

ASP.NET SQL Processes

Can someone please tell me how I get around this???

I have an ASP.NET web application that uses an SQL 2000 database for the
majority of the web sites content... If the application comes up with an
error the process on the SQL server remains alive. How do I make sure that
the process is killed on the SQL server even if there is an error???

I guess you use "TRY" but am new to asp.net programming and would appritiate
any examples or suggestions...

Thanks
Nov 19 '05 #1
2 1046
SQL server doesn't keep any processes attached to the application. It just
serves data access requests select/update/insert/delete. It doesn't care of
the application errors.

Eliyahu

"Tim::.." <Ti*@newsgroups.nospam> wrote in message
news:BF**********************************@microsof t.com...
Can someone please tell me how I get around this???

I have an ASP.NET web application that uses an SQL 2000 database for the
majority of the web sites content... If the application comes up with an
error the process on the SQL server remains alive. How do I make sure that
the process is killed on the SQL server even if there is an error???

I guess you use "TRY" but am new to asp.net programming and would appritiate any examples or suggestions...

Thanks

Nov 19 '05 #2
Hi Tim,

I think the "process" you mentioned maybe means the "connection" from the
client application which made between the client and server. Yes, there may
occur such connection leak when we didn't protect the code well in our data
accessing application. In .NET, when we use the ADO.NET's connection
objects to connect SQLServer or other DB, the .NET will internally manage a
connection pool, when we create SqlConnections, the ADO.NET will retrieve
connection from the pool if there is existing connection available,
otherwise, creating new connection and pool it into the pool. So in our
applicaiton which performing data access through ADO.NET, we just need to
make sure, we call connection.Close to release the connection (release it
back to the .net's internal conneciton pool's management) after we
finishing used it. In your scenario, you'd like to make sure database
connection get relesed when there occurs unexpected exceptions, I think you
can consider wrapper your data accessing code into the classic

try .... catch...finally code block, for example:

[c#]

SqlConnection conn;
SqlCommand comm;

try
{
conn = new SqlConnection (....);
} catch( xxxException ex)
{
......
}finally
{
//DataReader.close if exist
conn.close();
}

all the code in finally block will be guranteed to get executed. Also, in
C# , there exist the
Using(SqlConnection conn = new .....)
{
....
}

Using statement will ensure that the object create in the (..) will be
guranteed to release after the execution section.

#using Statement
http://msdn.microsoft.com/library/en...tatement.asp?f
rame=true

Here is another msdn reference describing the .NET's connection pool
regarding on SQLServer:

#The .NET Connection Pool Lifeguard
http://msdn.microsoft.com/library/en...TConnectionPoo
lLifeguard.asp?frame=true

Hope also helps. Thanks,

Steven Cheng
Microsoft Online Support

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


--------------------
| From: "Eliyahu Goldin" <re*************@monarchmed.com>
| References: <BF**********************************@microsoft.co m>
| Subject: Re: ASP.NET SQL Processes
| Date: Thu, 1 Sep 2005 11:47:27 +0200
| Lines: 22
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <O#**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 212.143.94.2
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:121657
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| SQL server doesn't keep any processes attached to the application. It just
| serves data access requests select/update/insert/delete. It doesn't care
of
| the application errors.
|
| Eliyahu
|
| "Tim::.." <Ti*@newsgroups.nospam> wrote in message
| news:BF**********************************@microsof t.com...
| > Can someone please tell me how I get around this???
| >
| > I have an ASP.NET web application that uses an SQL 2000 database for the
| > majority of the web sites content... If the application comes up with
an
| > error the process on the SQL server remains alive. How do I make sure
that
| > the process is killed on the SQL server even if there is an error???
| >
| > I guess you use "TRY" but am new to asp.net programming and would
| appritiate
| > any examples or suggestions...
| >
| > Thanks
|
|
|

Nov 19 '05 #3

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

Similar topics

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...
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? ...
1
by: jazon | last post by:
Let me start by saying this for an Operating Systems class. No, I don't expect the work to be done for me. The assignment is as follows: To be honest, I feel like a fish out of water, like...
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: 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
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...

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.