home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.ingres
- Path: sparky!uunet!tpghq!sfc
- From: sfc@tpghq.com (Steve Caswell)
- Subject: Re: Checking for SQL errors after commit
- Message-ID: <1993Jan28.142230.9603@tpghq.com>
- Organization: Palmer & Associates, Inc., Norcross, GA
- References: <26JAN199309454635@moose.cccs.umn.edu>
- Date: Thu, 28 Jan 1993 14:22:30 GMT
- Lines: 50
-
- In article <26JAN199309454635@moose.cccs.umn.edu> mcj@moose.cccs.umn.edu writes:
- >
- >In our 4gl code we are currently suppressing ingres errors from database
- >selects / inserts / updates. We then check for the error in the subsequent
- >statement using inquire_ingres.
- >
- >i.e. select a from tablex;
- > inquire_ingres (error_no = errorno);
- > if error_no !=0 then
- > rollback;
- > message 'Select error on tablex' with style = popup;
- > rollback;
- > return;
- > endif;
- >
- >Current coding does not check for an sql error after a commit statement.
- >I assume that an error can occur though during the commit and I am
- >wondering how likely this occurrence is , or would any problem with the
- >transaction log file have manifested itself before the commit was actually
- >reached.
-
- I have only seen commit fail once, and that was in a beta version of 6.4 when
- I was testing the set nologging feature. If you want your code to be 100%,
- absolutely, positively bullet-proof, you should add an error check after the
- commit. There is probably not much you can do to recover from the error, but
- you should at least tell the user (or a log file) that the commit failed and
- data may not have been stored. A commit error could also possible cause an
- inconsistent database, depending on whether the error was in the log file.
- The only safe method of recovery is checkpoint/journal. You can also mark
- your database as being consistent with the verifydb utility, using the
- -FORCE_CONSISTENT flag. However, this only flips the consistency bit and does
- not ensure that your data is consistent. You would have to do that by hand.
-
- >
- >
- > ------------------------------------------------------------------
- > Mark C. Jones (mcj@moose.cccs.umn.edu)
- > CSC Partners
- > 5500 Wayzata Blvd, Suite 1100
- > Minneapolis MN 55416 USA
- > +1 612 593 1122
- > ------------------------------------------------------------------
- >
-
-
- --
-
- Steve Caswell | (404) 448-7727 | "The opinions expressed are my
- Principal Consultant | sfc@tpghq.com | own. They may not be perfect,
- The Palmer Group | uunet!tpghq!sfc | but they're all I've got."
-