Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0DB679FA38F for ; Thu, 21 Dec 2006 10:54:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 39587-01 for ; Thu, 21 Dec 2006 10:54:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id D7F4B9FA339 for ; Thu, 21 Dec 2006 10:54:39 -0400 (AST) Received: (qmail 15017 invoked from network); 21 Dec 2006 14:54:38 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.14?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 21 Dec 2006 14:54:38 -0000 In-Reply-To: <20061221100121.EJOZ10325.mxfep02.bredband.com@mxfep02> References: <20061221100121.EJOZ10325.mxfep02.bredband.com@mxfep02> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <021E5266-98FD-4ECD-8CFD-FBEFE0CAA761@fastcrypt.com> Cc: Content-Transfer-Encoding: quoted-printable From: Dave Cramer Subject: Re: Exception-handling Date: Thu, 21 Dec 2006 09:54:35 -0500 To: =?ISO-8859-1?Q?H=E5kan_Jacobsson?= X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/111 X-Sequence-Number: 16343 The only general rule I adhere to is to make sure you clean up your =20 connections in a finally clause Dave On 21-Dec-06, at 5:01 AM, H=E5kan Jacobsson wrote: > Hi, > > I'm working against a postgresql database (version 8.0 ). > I was wondering how to handle exceptions properly when doing > database-related stuff, like queries, inserts etc. > > Often when I get an exception (I just catch an SQL exception in the =20= > catch > clause) I get a message saying call getNextException(). Should I =20 > always add > this code in the catch clause? Or should I always add a catch for =20 > catching > postgresql-exceptions? Is there a general rule for this? > > > > ---------------------------(end of =20 > broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate >