You are not logged in.
Pages: 1
Hi Arnaud,
Thank you very much. It works as expected now.
Hi everyone,
I'm encountering an exception within the TRestOrmServer.RecordVersionSynchronizeSlave function when using a synchronization model with only one table.
The issue seems to lie within mormot.orm.server, specifically around line 854:
if (t > PtrUInt(length(fRecordVersionMax))) or (fRecordVersionMax[t] = 0) then
InternalRecordVersionMaxFromExisting(t, {next=}false);
My model is defined as follows:
FModel := TOrmModel.Create([TMasterDataVersioned]);
The exception occurs only with this single-table model. If I define the model with additional tables, like so:
FModel := TOrmModel.Create([TMasterData, TMasterDataVersioned]);
or
FModel := TOrmModel.Create([TOrmTableDeleted, TMasterDataVersioned]);
the synchronization works correctly.
I've found a workaround by modifying the TRestOrmServer.RecordVersionSynchronizeSlave function as follows:
if (length(fRecordVersionMax) = 0) or (t > PtrUInt(length(fRecordVersionMax))) or (fRecordVersionMax[t] = 0) then
InternalRecordVersionMaxFromExisting(t, {next=}false);
With this change, the function operates as expected. Is this a known issue?
Could someone explain why this workaround is necessary and if there's a more appropriate solution?
Thanks in advance for any assistance.
Pages: 1