Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 81368 invoked from network); 25 Jun 2003 16:20:53 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 25 Jun 2003 16:20:53 -0000 Received: (qmail 20039 invoked by uid 97); 25 Jun 2003 16:23:16 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 20032 invoked from network); 25 Jun 2003 16:23:16 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 25 Jun 2003 16:23:16 -0000 Received: (qmail 81118 invoked by uid 500); 25 Jun 2003 16:20:51 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 81077 invoked from network); 25 Jun 2003 16:20:47 -0000 Received: from jim.skynet.lt (212.122.68.65) by daedalus.apache.org with SMTP; 25 Jun 2003 16:20:47 -0000 Received: (qmail 68031 invoked by uid 85); 25 Jun 2003 16:13:36 -0000 Received: from baliuka@centras.lt by jim.skynet.vl with qmail-scanner-1.03 (. Clean. Processed in 0.774997 secs); 25 Jun 2003 16:13:36 -0000 X-Qmail-Scanner-Mail-From: baliuka@centras.lt via jim.skynet.vl X-Qmail-Scanner: 1.03 (Clean. Processed in 0.774997 secs) Received: from unknown (HELO user) (10.1.17.1) by jim.skynet.lt with SMTP; 25 Jun 2003 16:13:35 -0000 Message-ID: <03c701c33b34$a1bef390$0111010a@user> From: "Juozas Baliuka" To: "Jakarta Commons Developers List" , References: <20030625154213.58103.qmail@web20711.mail.yahoo.com> Subject: Re: Checked vs Runtime exceptions Date: Wed, 25 Jun 2003 18:12:53 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > > In many cases that a database operation fails the next layer just cares > that it gets notified of the failure and logs it (you could also have > subclasses of MyException that indicate more specific failure types). > MyException is allowing other layers to be independent of the persistence > implementation exceptions like SQLException. > Next layer faills too, doe's not it ? If you will handle MyExeption this way in next layer you will log it twice and It will dublicate code. I think It is better log all fatal exeptions in single place, I prefer this way : void register(MyObject value){ Connection connection = getConnection(); updateOrInsert(connection,value); log.info(" registred " + value.getId() ); } The last layer ( resource management ) logs all unhandled exeptions and releases resources. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 2003.06.21 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org