• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
batchSync
#1
Hi all and LiveCloud team...

Just a quick question about BatchSync - I am using cdb_batchSync to update the cloud database from the local database at certain intervals... 
It certainly does the job, BUT... it seems to be a 'blocking' command, meaning that everything in the app stalls until the command completes.

Is there a 'non-blocking' version of this, or am i doing this wrong?

this is my algorithm for syncing the entire db in either direction:

command syncDB pSource
   local tTableNames, tTableID, tInputA, tMessage
   put cdb_tableNames() into tTableNames
   repeat for each line tTable in tTableNames
       put cdb_tableID(tTable) into tTableID
       put "*" into tInputA[tTableID]["cdbRecordID"]
       put pSource into tInputA[tTableID]["source"]
       put true into tInputA[tTableID]["allowDeletes"]
       put false into tInputA[tTableID]["detectCollisions"]
   end repeat
   get cdb_batchSync(tInputA)

   if cdb_result() is not true then
       put "Error syncing cloud <-> local database: " & cdb_result("response"into tMessage
       answer tMessage
   end if
end syncDB


I think it may just be a bit too complex to try and maintain a system that flags changes and only syncs them, not in the least as the data is relational involving multiple tables and is still being developed, so i would prefer a system that would just sync everything 'in the background' if that were possible... 

As it stands, the process to sync does not appear asynchronous and blocks the interface - grateful for any advice/tips (or if appropriate a feature request for an asynchronous sync!)

Many thanks
Stam
  Reply


Messages In This Thread
batchSync - by stamatis - 01-07-2021, 07:00 PM
RE: batchSync - by mark_talluto - 01-07-2021, 08:28 PM
RE: batchSync - by stamatis - 02-08-2021, 12:43 AM
RE: batchSync - by mark_talluto - 02-10-2021, 10:52 PM
RE: batchSync - by mark_talluto - 02-11-2021, 08:02 PM
RE: batchSync - by stamatis - 02-12-2021, 02:26 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)