× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ken

Just taking a poke at your preference, I have come to HATE pre-check logic. For performance reasons, I prefer to use EXCEPTION handling for any case where I might occasionally experience a problem, since checking for the problem EVERY time I execute is just plain wasteful.

I don't usually stress too much about joblog entries, but if the volume of exceptions is causing joblogs to get too big, then just remove the exception from the joblog as part of the exception handler.

JMO,
-Eric DeLong

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Ken Sims
Sent: Friday, October 19, 2012 3:32 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Pros and Cons of DB defined Referential Integrity Constraints

Hi Chuck -

On Fri, 19 Oct 2012 00:18:45 -0500, CRPence <CRPbottle@xxxxxxxxx>
wrote:

That is, consider this scenario: Is the key I am about to insert
already there? Lookup the key value. Not found, so let's insert.
Argh! Duplicate key error on the write!

Thus since the code likely needs to handle the duplicate key error
irrespective of this advance lookup having been coded to ensure the key
value does not exist, then how much value was there in checking first in
the application? Is it purely overhead? Perhaps just perform the
insert and handle the exception only if\when it occurs.?

I prefer to check first, and then also handle it on write, so as to
avoid error messages in the job log except in the rare circumstance
where some other job adds the record inbetween this job's check and
write.

Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.