#1 mORMot 1 » Master/slave replication with multiple tables » 2016-01-07 12:13:29

Fernandoprsbr
Replies: 9

Hi,

i'm trying to use the master-slave replication for some tables, but itsn't working as i wish..

on the master database i've something like this:

TableA:

ID    Name           RecordVersion
1     John Cenna    5180
2     Terry Crews   5182

TableB:

ID   Game              RecordVersion
1    Dota 2            5170
2    Besiege           5171

so, when i call the replication for the first table the records are synchronized properly:

FSlaveDatabase.RecordVersionSynchronizeSlave(TTableA, FMasterSQLHTTPConnection);

but when calling for TTableB, no records are synchronized.. and here's why: the internal method InternalRecordVersionMaxFromExisting loop through all my slave model (that matches with the master model of course), and find the max(RecordVersion) value from all tables, instead of considering only the current table.
That will return 5182 and, AFAIK, only records with RecordVersion>5182 will be retrieved from master.

My question is, why the recordversion is not table-based?

Board footer

Powered by FluxBB