You are not logged in.
Arnaud, RecordVersionSynchroniseSlave doesn't synchronize tables with blob fields if SLAVE db is PostgreSQL (tested with mormot.db.sql.postgres).
It affect only with synchronisation. If i use PostgreSQL on master server, saving blobs works ok. Synchronisation works ok if slave db is sqlite.
Last edited by avavdoshin (2023-02-27 09:27:28)
Offline
Could you investigate a little and find out what actually happens?
Batch prepared correct, but something happened in BatchSend, i suppose, because i've got error when step-by-step debug "TSqlDBPostgresStatement.ExecutePrepared: Invalid array type ftBlob on bound parameter #3" (it is one of my blob fields) "in mormot.db.sql.postgres.pas line 656"
Offline
Please try with https://github.com/synopse/mORMot2/commit/7609b12b
It would be slower, but should not raise any exception any more.
Offline
Please try with https://github.com/synopse/mORMot2/commit/7609b12b
It would be slower, but should not raise any exception any more.
It works now, but only if there is no deleted rows. If i have any deleted row - table doesn't synchronise at all.
Maybe it affected not only tables with blobs, i don't know. In my case i do not delete rows in another tables.
Offline
(i leave the same message in ISSUES on github)
First of all i delete all databases (master and slave)
Then i create new database on master (sqlite), create some orm instances (TSomeOrm, TSomeOtherOrm)
Then i create TMyBlobOrm instances with blobs (just simple strings in blob) on master, they had IDs 1,2,3,4,5,6
Then i delete TMyBlobOrm with id 4 on master
then create some other orm instances (TSomeAnotherORM) on master
Then i create SLAVE database (postgres) and synchronise from master (sqlite) to slave (postgresql) (calling RecordVersionSynchroniseSlave from slave).
In step-by-step debug i've got error
"Unexpected TSqlDBPostgresConnectionProperties.SharedTransaction (1,2)" in mormot.db.sql line 3701
Maybe it's because in prepared for sending batch i see in JSON that DELETE goes before all other lines? But this record cannot be deleted, it doesn't exist on slave server yet.
If i only create orm instances on master (with or without blobs, but do not delete any instance) - synchronise works ok
Offline
fails on TRestOrmServerBatchSend.AutomaticCommit after sequence POST-POST-POST-POST-DELETE-POST if ID for delete doesn't exists. Can't find out reason yet. No error message except "TSqlDBPostgresConnectionProperties.SharedTransaction( )"
upd: If i comment whole part for encDelete in TRestOrmServerBatchSend.ExecuteValue it fails too with the same exception
Last edited by avavdoshin (2023-03-02 14:58:59)
Offline
Is it the same if the slave is SQlite3?
No, there is no problem at all if the slave is SQlite3.
Offline