Subject | Re: Database replication - problem with uncommited transactions. |
---|---|
Author | franbenz |
Post date | 2010-03-23T16:53:28Z |
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@...>
wrote:
I think I need to explain a little bit further my problem.
When the replication process starts it looks on another table which was
the last record sent from the audit table to the destination database.
The process should send cronologically all records following the last
sent record. The problem is that sometimes when the process starts there
are some uncommited records in the audit table between other commited
records. In this situation the process sends all visible records and
saves which record is the NEW "last sent record". Sometime after the
replication ends, those uncommited records are commited and are never
sent since they got primary keys previous to the new last sent record.
This is why I must only send those audit records which have primary keys
that are previous to the uncommited records.
Hope this clarifys my problem.
Thanks.
wrote:
>be
> >
> > I need transaction 4 to know that pkey=3 is the last record that can
> > cronologically copied to my destination database.copy
> > I know transaction 4 can see pkey=5 and pkey=6, but it shouldn't
> > those records until previous records (in this example pkey=3) areis in,
> > commited.
> > The replication process is started periodically. So hopefully, next
> > time it starts, transaction #3 will already be commited and records
> > 4,5,6 will be copied.
> >
> >
> It won't see pk3 if pk 3 records are not committed.
> I think you're missing the point. Whatever state the the comitted DB
> it's in a consistent state. Whenever your replication process startsit sees
> commited records (including your audit table). Your replicationprocess can
> safely process those records there and then.you
> Why don't you download the source of fbreplicator at www.meta.com.au,
> will see quite clearly, the logic behind replication.Thanks Alan, I'll download the source and take a look at it.
> Alan
I think I need to explain a little bit further my problem.
When the replication process starts it looks on another table which was
the last record sent from the audit table to the destination database.
The process should send cronologically all records following the last
sent record. The problem is that sometimes when the process starts there
are some uncommited records in the audit table between other commited
records. In this situation the process sends all visible records and
saves which record is the NEW "last sent record". Sometime after the
replication ends, those uncommited records are commited and are never
sent since they got primary keys previous to the new last sent record.
This is why I must only send those audit records which have primary keys
that are previous to the uncommited records.
Hope this clarifys my problem.
Thanks.