Article View: borland.public.interbase.replication
Article #7Re: Changing primary key and replicate this value
From: David Domingo
Date: Fri, 20 Feb 2004 18:31
Date: Fri, 20 Feb 2004 18:31
50 lines
3046 bytes
3046 bytes
"Bill Todd (TeamB)" <no@no.com> escribi๏ฟฝ en el mensaje
news:mcic30d6avuml13ilsuokrerfncilfpjtu@4ax.com...
> On Fri, 20 Feb 2004 11:12:14 +0100, "David Domingo"
> <david.domingo@starseguridad.com> wrote:
>
> >Then, what is the purpose of foreign keys with update cascade? ;)
>
> The purpose is to allow you to use an unstable attribute for the
> primary key. This does not make it a good idea. As you have already
> discovered, an unstable primary key makes replication very difficult.
> Unstable primary keys also cause concurrency problems. Suppose you
> have a table with an unstable key and this table has a one-to-many
> relationship with a table that has the cascade update option for its
> foreign key. One user changes the primary key value in the master
> table. Another user has changed one of the detail records and has not
> committed yet. Since one of the detail records is locked the primary
> key change cannot be cascaded. Depending on the transaction options of
> the user trying to change the primary key he/she will either get an
> error or hang until the user changing the detail record either commits
> or rolls back.
>
> Stability is second only to uniqueness in importance when choosing a
> primary key. If there is no attribute or combination of attributes
> that is both unique and stable use a surrogate primary key. You will
> save yourself a lot of headaches.
>
Ok thanks, but this question is one question with irony. Of course I know
what is the purpose of update cascade.
Sorry but I can't be in agreement with your exposition.
The only one change in current version of IBRepl is in UPDATE:
update TABLE set PRIMARYKEY=NEWKEYVALUES,..... where
PRIMARYKEY=OLDKEYVALUES
But if you cant do this changes dont worry. When own replicator engine is
finished we will sent you a copy for your evaluation. That's ok?
THANKS and regards from Spain.
> --
> Bill (TeamB)
> (TeamB cannot respond to questions received via email)
Technical Details
Message-ID:
<403653d3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4034dce9$1@newsgroups.borland.com> <4034e8dc$1@newsgroups.borland.com> <4035deb9$1@newsgroups.borland.com> <mcic30d6avuml13ilsuokrerfncilfpjtu@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f89d7,2f886c55ebe3c509 X-Google-Attributes: gidf89d7,public X-Google-ArrivalTime: 2004-02-20 10:40:31 PST From: "David Domingo" <david.domingo@starseguridad.com> Newsgroups: borland.public.interbase.replication References: <4034dce9$1@newsgroups.borland.com> <4034e8dc$1@newsgroups.borland.com> <4035deb9$1@newsgroups.borland.com> <mcic30d6avuml13ilsuokrerfncilfpjtu@4ax.com> Subject: Re: Changing primary key and replicate this value Date: Fri, 20 Feb 2004 19:31:52 +0100 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 80.34.254.3 Message-ID: <403653d3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077302227 80.34.254.3 (20 Feb 2004 10:37:07 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail