Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Java Checked Exceptions Date: Mon, 8 Feb 2016 20:55:06 +0100 Lines: 23 Message-ID: References: <56b601cc$0$23722$e4fe514c@news.xs4all.nl> <25c9bda0-2d07-4339-a7cd-2b868584117d@googlegroups.com> <1eb89683-ed9b-4b03-b846-8e24c9f87a4a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net NU7dez702BORWskbXB5z3AXhNeskX43+PF2+tIE970yvemjh4= Cancel-Lock: sha1:tw/HPCcNyIdG/1cw+rtpTXlXies= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: <1eb89683-ed9b-4b03-b846-8e24c9f87a4a@googlegroups.com> Xref: csiph.com comp.lang.java.programmer:33686 On 08.02.2016 15:14, boxzou@gmail.com wrote: > On Monday, 8 February 2016 07:30:37 UTC-5, Robert Klemme wrote: >> And you use JPA to abstract the concrete database model used so it would >> be very unwise to start writing catch clauses for all sorts of database >> specific exceptions (apart from the fact that this is often not possible >> because you add JDBC drivers at deployment time so the compiler does not >> see them). So it is practically not possible (even with unchecked >> exceptions!) and it is not wise from a modularity point of view. And it >> is not needed since you usually get all the details of nested exceptions >> in an application's log. > JPA does not throw SQLException. It does not assume it will only deal with relational database. Right, yes. Thank you for correction! The point is still that, whatever a library / module throws, as a user of that module you would not want to catch detailed exceptions of underlying layers of software. robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/