Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 9141 invoked from network); 4 Dec 2009 18:58:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Dec 2009 18:58:33 -0000 Received: (qmail 40688 invoked by uid 500); 4 Dec 2009 18:58:32 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 40649 invoked by uid 500); 4 Dec 2009 18:58:31 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 40641 invoked by uid 99); 4 Dec 2009 18:58:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Dec 2009 18:58:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of clinton.begin@gmail.com designates 74.125.92.145 as permitted sender) Received: from [74.125.92.145] (HELO qw-out-1920.google.com) (74.125.92.145) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Dec 2009 18:58:23 +0000 Received: by qw-out-1920.google.com with SMTP id 14so498138qwa.60 for ; Fri, 04 Dec 2009 10:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=56Z+4o75i8IcThvxYyrEZL9B/mX2Sa95YDxItfbzcF4=; b=m0KvznFMR/hRsj9sxH+HxzHeyEhqpbr936gJS9CFdNPNpMuC4rTz9XwB76bkq2An4V 1D4ibc2uYU0ywk9PXcaGlS8dzCZCg6jBC6Yd4CRuiDEXKK7xPRZ92+ey6MQBSOGIe7im pxllyCkWFlmLuohQtz35b2kPJlMtbW8hsbcoY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aS0n0QvbUOFcJPU4y3lOnekYLDugBrtFjOywIGIrCosPrfcIe0pksHPwyJzyWSC0p1 eyXQo+/DWffiELgP8vMGXGgYfxu3O0vySwJihA2wsmYPvZwHX1/3JV6Bpgf/f7jyJ3y0 ZkJqZr/29+XkyEHmdO9L2NoQc8b+OurLKu6uo= MIME-Version: 1.0 Received: by 10.224.69.136 with SMTP id z8mr1922072qai.85.1259953082223; Fri, 04 Dec 2009 10:58:02 -0800 (PST) In-Reply-To: <07094E40F055C34FA35BB28DB1670E7FD16CC4@bibbmail.bibb.com> References: <4B182A79.9050207@acadiasoft.com> <16178eb10912031747w6e1ff0fbuf980cad47f921408@mail.gmail.com> <07094E40F055C34FA35BB28DB1670E7FD16CC4@bibbmail.bibb.com> Date: Fri, 4 Dec 2009 11:58:02 -0700 Message-ID: <16178eb10912041058n428c74ado9ce712d16126c3fc@mail.gmail.com> Subject: Re: IBatis 3 Exceptions From: Clinton Begin To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=0016e64cc952e64d250479ebaf58 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64cc952e64d250479ebaf58 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I have done things like retry logic and/or switching to a different databas= e in a cluster -- but at all costs I try to do that at the driver level (with a driver proxy class), rather than in the business logic. But even if I di= d it in the business logic, while I might catch the exception for the retry, = I would not distinguish the failure. This is really rare though, and I can't remember the last time I did it. Currently where I work they do the cluster failover logic in a driver proxy as I mentioned. Cheers, Clinton On Fri, Dec 4, 2009 at 10:27 AM, Rick.Wellman wrot= e: > Agreed on both points below=85 but am curious to the community at large= =85 > has anyone come up with something useful to do on a database exception ot= her > than apologize to the user? This might be a good forum to share. > > > > *From:* Clinton Begin [mailto:clinton.begin@gmail.com] > *Sent:* Thursday, December 03, 2009 7:47 PM > *To:* user-java@ibatis.apache.org > *Subject:* Re: IBatis 3 Exceptions > > > > Nope. Nothing technical. I just happen to hate checked exceptions. :-) > > The original exception is always nested within the runtime one though, so > you have full access to everything you need. > > There is a bit of placeholder code where I had intended to build a > hierarchy of exceptions, similar to Spring's exceptions. But honestly, I > cannot recall a time in my 12 years of Java coding when I could actually = do > something useful with a database exception, other than apologize to the u= ser > with a dialog box. > > Clinton > > On Thu, Dec 3, 2009 at 2:15 PM, Alex Sherwin > wrote: > > Why does IBatis 3.0 throw IbatisException (RuntimeException) instead of > checked exceptions? > > Is this a limitation now due to the dynamic nature of the generic typed > mapped statement classes? IbatisException doesn't even seem to wrap > SQLException, I see it wrapping the native exceptions from my JDBC driver > (MySQL). > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org > For additional commands, e-mail: user-java-help@ibatis.apache.org > > > --0016e64cc952e64d250479ebaf58 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I have done things like retry logic and/or switching to a different databas= e in a cluster -- but at all costs I try to do that at the driver level (wi= th a driver proxy class), rather than in the business logic.=A0 But even if= I did it in the business logic, while I might catch the exception for the = retry, I would not distinguish the failure.=A0

This is really rare though, and I can't remember the last time I di= d it.=A0 Currently where I work they do the cluster failover logic in a dri= ver proxy as I mentioned.

Cheers,
Clinton

On Fri, Dec 4, 2009 at 10:27 AM, Rick.Wellman <Rick.Wellman@kiewit.com> = wrote:

Agreed on both points below=85 but am curious to the community at large=85 has anyone come up with something useful to do on a database excep= tion other than apologize to the user?=A0 This might be a good forum to share.

=A0

From:= Clinton Begin [mailto:clinto= n.begin@gmail.com]
Sent: Thursday, December 03, 2009 7:47 PM
To: user-java@ibatis.apache.org
Subject: Re: IBatis 3 Exceptions

=A0

Nope.=A0 Nothing technical.=A0 I just happen to hate checked exceptions.=A0 :-)

The original exception is always nested within the runtime one though, so y= ou have full access to everything you need.=A0

There is a bit of placeholder code where I had intended to build a hierarch= y of exceptions, similar to Spring's exceptions.=A0 But honestly, I cannot r= ecall a time in my 12 years of Java coding when I could actually do something use= ful with a database exception, other than apologize to the user with a dialog box.=A0

Clinton

On Thu, Dec 3, 2009 at 2:15 PM, Alex Sherwin <alex.sherwin@= acadiasoft.com> wrote:

Why does IBatis 3.0 t= hrow IbatisException (RuntimeException) instead of checked exceptions?

Is this a limitation now due to the dynamic nature of the generic typed map= ped statement classes? =A0IbatisException doesn't even seem to wrap SQLException, I see it wrapping the native exceptions from my JDBC driver (MySQL).

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

=A0


--0016e64cc952e64d250479ebaf58--