Re: Exception handling
- From: "Val Mazur \(MVP\)" <group51a@xxxxxxxxxxx>
- Date: Thu, 21 Apr 2005 20:28:24 -0400
Hi,
May it is wise, but it is not simple, because you could face different
exceptions, which your code did not predict. You definitely could handle
part of them and do not throw user-defined exception, but just make some
steps to exit from this situation.
Regarding broken connection: you will not get exception automatically if
connection was broken for some reason. Provider does not check if connection
is broken or not until it requires to execute some statement against
database. In this case you could get different types of exception depending
on what you are trying to do. In most cases you will get SqlException.
--
Val Mazur
Microsoft MVP
http://xport.mvps.org
"Bevo" <Bevo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3404866D-7BE8-445B-9E2C-F49EACAAF917@xxxxxxxxxxxxxxxx
> In my enterprise application I'd like my DataAccess layer to be
> responsible
> for handling all database error situations and to basically throw custom
> exceptions according to whether db connection is ok or not, that is,
> cDBDownException if ok or cDBException if not ok. These two exceptions
> would
> provide all information about the original cause etc.
>
> 1. Is this a wise exception handling policy?
>
> 2. We use both Oracle and SQL Server. Which exceptions do I catch to
> ascertain that we've lost contact with the db?
>
> Kind regards.
>
.
- References:
- Exception handling
- From: Bevo
- Exception handling
- Prev by Date: Secure Access MDB with VB 6.0 - How?
- Next by Date: RE: junction tables: how to insert data
- Previous by thread: Exception handling
- Next by thread: Secure Access MDB with VB 6.0 - How?
- Index(es):
Relevant Pages
|
|