🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #55

Re: passing information to be displayed in exception ??

#55
From: Martijn Tonies
Date: Sun, 25 May 2008 13:30
33 lines
2205 bytes
> > If the exception (in the database) causes the client app to rollback
> > it's changes, the data won't be in the table either.
>
> Good point. The rollback must be done after you get any information you
> need from the database.

There's more to it, actually. Stored Procedure/Trigger code has implicit
savepoints that are rolled back as soon as an exception occurs in the
block that has the exception handling. I've researched some of this for
a presentation I did last year at the Firebird Conference. It's quite easy
to get confused here.

It also matters if you're calling another procedure or writing code in-line.

So, whenever you catch an exception, you need to log your message
into another table and re-raise your exception from a different
begin..end block with it's own exception handler.

I think ... ;-)

Either way, this requires some careful testing :)


-- 
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Technical Details
Message-ID: <483968f4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4831a020@newsgroups.borland.com> <4831c7a5$1@newsgroups.borland.com> <483573ff@newsgroups.borland.com> <4835871e@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,4bd5c26775487a13
X-Google-Attributes: gid114a0e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Martijn Tonies" <m.tonies@upscene.removethis.com>
Newsgroups: borland.public.interbase.sql
References: <4831a020@newsgroups.borland.com> <4831c7a5$1@newsgroups.borland.com> <483573ff@newsgroups.borland.com> <4835871e@newsgroups.borland.com>
Subject: Re: passing information to be displayed in exception ??
Date: Sun, 25 May 2008 15:30:28 +0200
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1914
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914
NNTP-Posting-Host: 212.238.159.172
Message-ID: <483968f4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1211721972 212.238.159.172 (25 May 2008 06:26:12 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail