Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to handle Accumulating fields in replication

3 posts in Replication Last posting was on 2006-06-01 16:09:49.0Z
Paul Man Posted on 2006-05-17 14:48:59.0Z
From: "Paul Man" <paulman@datasoft.ie>
Newsgroups: advantage.Replication
Subject: How to handle Accumulating fields in replication
Date: Wed, 17 May 2006 15:48:59 +0100
Lines: 10
Organization: DSoft
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: 82.141.233.142
Message-ID: <446b3723@solutions.advantagedatabase.com>
X-Trace: 17 May 2006 08:45:55 -0700, 82.141.233.142
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!82.141.233.142
Xref: solutions.advantagedatabase.com Advantage.Replication:123
Article PK: 1133981

Say I have site a and site b replicating.
A generates customer transaction data that updates a customer balance
B does the same. If the customer record is overwritten during replication
where both sites have updated the customer balance then one of the balance
updates gets lost.

What's the best way to handle this? As the code is legacy, there is no
trigger on the customer transaction data to update the balance.


Joachim Duerr (ADS Support) Posted on 2006-05-17 16:55:42.0Z
From: "Joachim Duerr (ADS Support)" <jojo.duerr@gmx.de>
Subject: Re: How to handle Accumulating fields in replication
Newsgroups: Advantage.Replication
References: <446b3723@solutions.advantagedatabase.com>
Organization: iAnywhere
User-Agent: XanaNews/1.18.1.2
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 192.168.2.197
Message-ID: <446b477e@solutions.advantagedatabase.com>
Date: 17 May 2006 09:55:42 -0700
X-Trace: 17 May 2006 09:55:42 -0700, 192.168.2.197
Lines: 17
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!192.168.2.197
Xref: solutions.advantagedatabase.com Advantage.Replication:124
Article PK: 1133982


Paul Man wrote in <446b3723@solutions.advantagedatabase.com>:

> Say I have site a and site b replicating.
> A generates customer transaction data that updates a customer balance
> B does the same. If the customer record is overwritten during
> replication where both sites have updated the customer balance then
> one of the balance updates gets lost.

you'll get a conflict and you need to resolve that conflict via an ON
CONFLICT trigger. Within that trigger code you can decide to keep one
or the other - or to recalculate the balance again.

--
Joachim Duerr
Senior Product Support Analyst (Advantage Database Server)
iAnywhere Solutions / Extended Systems
advantage[AT]extendsys.de


Paul Man Posted on 2006-06-01 16:09:49.0Z
From: "Paul Man" <paulman@datasoft.ie>
Newsgroups: Advantage.Replication
References: <446b3723@solutions.advantagedatabase.com> <446b477e@solutions.advantagedatabase.com>
Subject: Re: How to handle Accumulating fields in replication
Date: Thu, 1 Jun 2006 17:09:49 +0100
Lines: 44
Organization: DSoft
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: 82.141.233.142
Message-ID: <446b4a18@solutions.advantagedatabase.com>
X-Trace: 17 May 2006 10:06:48 -0700, 82.141.233.142
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!82.141.233.142
Xref: solutions.advantagedatabase.com Advantage.Replication:125
Article PK: 1133983

to recalculate, I'd need to be sure that the transaction details have been
replicated prior to the customer record so that I could update the balance
on the target to add the total of the transaction details. Also it means
maintaining two sources of balance calculation. Is it possible to ensure
that the transaction details table is replicated prior to the header (
customer record ) table? Otherwise do I have access to the old value for the
source table so that I could update the target balance with the difference?

e.g
site Balance Before Balance After
=================================.
A 50 65
B 50 75

After Update should be
B 85

i.e. I'd need to add the difference of the A.__OLD and A.__NEW balance to
the B.balance.
So does the conflict trigger give access to the A.old and A.new values to
add to the B.balance?

"Joachim Duerr (ADS Support)" <jojo.duerr@gmx.de> wrote in message
news:446b477e@solutions.advantagedatabase.com...
> Paul Man wrote in <446b3723@solutions.advantagedatabase.com>:
>
>> Say I have site a and site b replicating.
>> A generates customer transaction data that updates a customer balance
>> B does the same. If the customer record is overwritten during
>> replication where both sites have updated the customer balance then
>> one of the balance updates gets lost.
>
> you'll get a conflict and you need to resolve that conflict via an ON
> CONFLICT trigger. Within that trigger code you can decide to keep one
> or the other - or to recalculate the balance again.
>
> --
> Joachim Duerr
> Senior Product Support Analyst (Advantage Database Server)
> iAnywhere Solutions / Extended Systems
> advantage[AT]extendsys.de