Subject | Re: Database replication - problem with uncommited transactions. |
---|---|
Author | franbenz |
Post date | 2010-03-27T13:15:04Z |
--- In firebird-support@yahoogroups.com, "Jarrod Hollingworth"
<jarrod@...> wrote:
But your first idea seems simpler, I'll try that first.
Thanks Jarrod.
<jarrod@...> wrote:
>and
> Hi,
>
> I developed a two-way merge replication system between a single server
> multiple clients. It certainly wasn't trivial.chronologically
>
> > I'm developing a replication scheme and I need to copy
> > modifications of a database to another one.replicated
>
> I would first question whether you really do need them to be
> chronologically, and do you mean chronologically based on when theoperation
> that caused the audit entry was performed (audit pkey generated) orbased on
> the times that the transactions were committed?transaction
>
> If you really do need to process them in pkey order:
> Consider that transaction #4 has no way to know whether or not
> #3 will be successfully committed. You can only detect this bychecking
> again later after a reasonable amount of time (try to keep transactionthe
> durations as short as possible). That being the case you could store
> server time in each audit entry and process the audit rows forreplication
> while they are contiguous (no missing pkey) or the time of the rowafter the
> gap is sufficiently old to consider that the rows in the gap willnever
> appear. It would probably be better to use a selectable storedprocedure to
> do this else some work on the client, rather than a single SQLstatement.
>be
> If it is ideal to process them in pkey order but it does not need to
> perfect (such as processing the uncommitted row above in the nextlast
> replication):
> You just need to determine the missing entries to process since the
> time that you replicated. To do this store the pkey and time of thelast
> entry processed in the replication. On next replication time processa) all
> entries with a higher pk, and b) all entries prior to the last pkeywhere
> the time is within X minutes prior to the last time, skipping thosepkeys
> that exist in your SENT_AUDIT_RANGES table.I think my processing order doesn't need to be in perfect pkey order.
>
> Regards,
> Jarrod Hollingworth
But your first idea seems simpler, I'll try that first.
Thanks Jarrod.