Re: Can these constraint be implemented in an RDBMS ?

From: ben brugman <ben_at_niethier.nl>
Date: Tue, 2 Mar 2004 16:45:32 +0100
Message-ID: <4044ac1c$0$3681$4d4ebb8e_at_read.news.nl.uu.net>


>
> I've not checked the problem definition in detail, but I suspect both
> the SQL DBMS you mentioned can manage it - unless Bob was being too
> brusque in dismissing the problem as solvable. And most of the
> others, with the probable exception of MySQL (and even that might be
> mildly slanderous), can handle it too.
>
For Oracle :

Because of snapshot isolation and read rows are not allowed to be altered by other transactions during a transaction, there is a problem. Even using triggers to check on certain constraints you run into this problem.

For SQL-server the transaction probably has to run in serializable mode, the checks probably have to be made in triggers. This might lead to undesirable deadlocks.

Both might not run very efficient.
Maybe indexed views for checking the constraints would work.

The problem is derived from two accounts which together are not allowed to be negative. (Used to illustrate Oracle's failure to implement serializability (as defined in most dictionaries and in the SQL-standard).) Most solutions I have seen involve some application coding. And often a denial that you actually want those constraints.

I cannot comment on Bob, because I am not capable of drawing information out of them. (Offcourse this is my problem). And according to Bob, my organisations uses the wrong people, the wrong database and the wrong model. So his remarks are not usefull for our situation.

Alfredo Novoa <alfredo_at_ncs.es> did give a solution to the problem, although not implementable (yet), but this is a theory newsgroup.

I am a bit more practical. I would like to implement a solution on a available "RDBMS" (Oracle or SQL-server) and under economic conditions.
(Meaning, with the given set of programmers, within the given time and limited capacity for the production machine). In theorie this is impractical.

thanks for your time,
ben brugman.

> --
> Jonathan Leffler #include <disclaimer.h>
> Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
> Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
>
Received on Tue Mar 02 2004 - 16:45:32 CET

Original text of this message