Page 1 of 1

tcrbatchmove question

Posted: Wed 18 Jul 2007 02:45
by Prismax
Hello,

I've written my own application to synchronize two databases using the tcrbatchmove component.

But today I discovered a serious problem in the application. Everytime I insert or update a record in the first DB, I see the same change in my second DB (after running my sync application off course). But a deletion seems not to be synchronized. I deleted something in the first DB and it's still there in the second DB.

I use the bmAppendUpdate mode which explains why deletions aren't synchronized.

BUT :

I just want something that says : make the second table an exact copy of the first one (including all inserts, updates, deletes)... How to do this?

Posted: Wed 18 Jul 2007 05:51
by swierzbicki
What happens if you first truncate the destination table ? (all records will be erasaed) and then do an BatchMove ?

Posted: Wed 18 Jul 2007 13:24
by Antaeus
Another way that should be pretty fast, is to execute CRBatchMove twice. First time in bmDelete mode, second time in bmAppendUpdate mode.

Posted: Tue 31 Jul 2007 22:37
by Prismax
Can I do this in two steps without consequences? First the bmDelete and then the bmAppendUpdate?

My situation is :
I have one central database and every user has a local database on their own laptop (to work fast and to work offline too). So every executable checks every five minutes and updates all the changes from the local to the central database and then again from the central to the local database to find the changes added by other users...

So I need a situation where every local database is as up-to-date as possible but it cannot be more frequent then every five minutes, because the whole action of performing the batchmove to every table in the DB takes a few minutes...

Posted: Wed 01 Aug 2007 12:29
by Antaeus
Thank you for information. We will investigate a possibility to add one more mode to TCRBatchMove in one of the next MyDAC builds/versions.

Posted: Wed 01 Aug 2007 17:41
by Prismax
That would be really fantastic!

Now I use the following :

- First I go through every table and perform a batchmove in bmAppendUpdate mode from the local to the central database to add the changes made by the local user
- then I immediately start a new procedure performing the same (batchmove for every table using bmAppendUpdate) but in the other direction (from central to local) to add the changes made by other users.
This works great for inserts and updates, but not for deletions (as mentioned above).

Thx for the positive reply

Posted: Wed 01 Aug 2007 21:56
by ben
What happens if you first truncate the destination table ? (all records will be erasaed) and then do an BatchMove ?
that's not synchronization. synchronization means update/delete only records changed. not the entire table. otherwise is just a table backup.

Posted: Wed 01 Aug 2007 21:57
by ben
Prismax,

can I ask for a sample app of that synchronization you have done?

Posted: Fri 10 Aug 2007 19:52
by Prismax
I can now write an addition to my sync which will forward a deletion on local base to the central DB but then again, the problem is that there's no possibility to forward this change from the central DB to the local databases of the other users.
So a bmAppendUpdateDelete mode will be very handy, cause now it causes quite a few problems in my app (through deletions which cannot be forwarded to everyone and thus it makes no sense to even forward it to the central DB).

Do you have any idea when this can be added to a build?

Ben,
You can always send me a message, so I can explain how I worked to make the sync.

Posted: Sat 11 Aug 2007 09:35
by ben
Prismax wrote: Ben,
You can always send me a message, so I can explain how I worked to make the sync.
Private messaging has been disabled on this board.

Any idea? :)

Posted: Thu 16 Aug 2007 02:02
by Prismax
"Any idea" --> was a question to the people of CRLab. :o

Posted: Fri 17 Aug 2007 08:19
by Antaeus
Currently private messages are disabled on the forum. Please contact each other by e-mail.