#1 2017-10-09 14:17:07

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Adding TRecordVersion to existing Table(s)

Hi AB,

i have an old ORM with > 10 Tables and want to add Replication.

My idea was : Add TRecordVersion to every TSQLRecord - worked - but Version = null
I tried to Replicate all Tables on other Server with code like this:

    TAutoFree.One(FMasterClient, TSQLHttpClientWinHTTP.Create(AnsiString(FMasterHostname), AnsiString(FMasterRESTPort), Model, FMasterUseHTTPS));
    FMasterClient.IgnoreSSLCertificateErrors := true;
    FMasterClient.Compression := [hcSynShaAes];
    if FMasterClient.SetUser(cUsername, cPassword) then begin
      DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord1, FMasterClient);
      DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord2, FMasterClient);
      DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord3, FMasterClient);
      DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord4, FMasterClient);
      DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord5, FMasterClient);
    end;

But nothing happend - then i thought (without reading your code)
set Version on Master to 1
But only TSQLRecord1 will be updatet then.

I think the Problem is that Verion on master is wrong initialized. I Think i have to set Version to a "unique" sequential ID or for every Table ?

or better can you enhance it to

      DFLizenz.Database.RecordVersionSynchronizeSlave([TSQLRecord1, TSQLRecord2, TSQLRecord3, TSQLRecord4, TSQLRecord5], FMasterClient);

BR
Stefan


Rad Studio 12.1 Santorini

Offline

#2 2017-10-09 21:02:47

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Re: Adding TRecordVersion to existing Table(s)

My Problem has to do with this Ticket

https://synopse.info/fossil/info/74e76e975a401

I know now Version is a sequential number. What do you think about using Version as Timestamp with high Resolution ?


Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB