473,831 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1059
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******** *************** ***********@mic rosoft.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.Clos e 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.clos e if exist
conn.close();
}

all the code in finally block will be guranteed to get executed. Also, in
C# , there exist the
Using(SqlConnec tion 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.co m>
| References: <BF************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 212.143.94.2
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP10.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1216 57
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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******** *************** ***********@mic rosoft.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
4902
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
23089
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 to a pool. If I assign only one application to a applicaton pool and have multiple worker processes assigned to that pool. Will my application be processed by many worker processes?
4
7833
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 servers are in a stateless farm and have 2 GB of RAM. We are using ASP.NET 1.1 when using a dedicated application pool for each virtual directory. Each customer gets their own virtual directory and copy of the ASP.NET dll in their bin folder, which...
35
4053
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? I've been leaning towards threads, I'm going to say why. Processes seem fairly expensive from my research so far. Each fork copies the entire contents of memory into the new process. There's also a more expensive context switch between...
1
3571
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 many of the others in the class. We haven't been exposed to any Unix and the professor hasn't, yet, said much more than the book, which is no help at this point. From what I've figured out and what I've blindly seen on the net and hoped would...
0
9642
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
10778
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10496
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...
0
9319
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...
1
7750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
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
4419
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
3967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3077
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.