Re: Handling exceptions
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Mon, 11 Aug 2008 20:25:58 -0400
Cor Ligthert[MVP] wrote:
"Arne Vajhøj" <arne@xxxxxxxxxx> schreef in bericht news:489f78cd$0$90269$14726298@xxxxxxxxxxxxxxxxxxCor Ligthert[MVP] wrote:Can you point me where your answer is about. I don't have the idea to have written anything about a Status.Jon,And of course nothing *ever* goes wrong with valid SQL... The databaseAs far as I know them will the SQLException ignore all of those problems you are showing
never goes down, there are never concurrency violations, locking
problems, failing to find expected data etc.
The SQLexception is needed to check if a stored procedure or an parameter in that does not exist.
But you are in my opinion a jerk of a developer as you are testing that at run time.
No.
ADO.NET does not return status values.
Either it is a success all the way through or you get an
exception.
The only bad thing about the exception is that you get the
same exception type for too many different problems. I guess
that will be fixed in .NET 4.0 or 5.0 !
There are only two alternatives for returning errors: exceptions and
status codes. So since .NET does not have status codes, then the
choices are somewhat limited-
But what you wrote is in my opinion true, although you can catch with the SQLException some information why the SQL transaction on the Server Side went wrong.
You can, but that is very bad OOP.
However, in my opinion a designer should fix all those errors which are catched here fix before he gives his program in production.
None of the problems Jon list is permanent problems. They can
happen in production even if they do not happen in test.
And even if the database server did go down under test, then I am not
quite sure what the designer should fix ? Not use a database ??
> (Or catch them at client side as it is hardware dependend, I
have never seen a server, which was down, give any information)
I am not quite sure what you mean by client and server here, but
since it is about database access let us assume database client
and server.
If the database server si down, then the database client will
get an exception and need to handle it. Like Jon explained.
Arne
.
- Follow-Ups:
- Re: Handling exceptions
- From: Cor Ligthert[MVP]
- Re: Handling exceptions
- References:
- Handling exceptions
- From: Sweetiecakes
- Re: Handling exceptions
- From: Cor Ligthert[MVP]
- Re: Handling exceptions
- From: Jon Skeet [C# MVP]
- Re: Handling exceptions
- From: Cor Ligthert[MVP]
- Re: Handling exceptions
- From: Arne Vajhøj
- Re: Handling exceptions
- From: Cor Ligthert[MVP]
- Handling exceptions
- Prev by Date: Re: Developing a C# Webcrawler
- Next by Date: Re: Handling exceptions
- Previous by thread: Re: Handling exceptions
- Next by thread: Re: Handling exceptions
- Index(es):
Relevant Pages
|