on 06-24-2016 3:36 PM
I've implemented a standard timestamp-based download in a MobiLink setting with SQL Anywhere 16 as consolidated and remote.
SELECT t.PkCol1, t.PkCol2
FROM ShadowTable t
WHERE t.Last_Modified_Ts >= {ml s.last_table_download}
What I've observed is that when the remote deletes a row, this sequence occurs:
This happens with all uploaded actions. It's true this does no harm (delete has no row to delete, insert and update are both processed as updates, but with identical data to the row on the remote). But it is wasteful of bandwidth and synchronization time, especially when the remote makes a lot of changes.
Is there any method that prevents these redundant actions?
-Eric Murchie-Beyma
Hi Eric,
I'm not aware of any option or switch to control this. If you want to eliminate these harmless (except for bandwidth) downloads, I suggest the following approach:
- set up a session table (global temporary or local temporary) with "on commit preserve rows" or "not transactional" matching the shadow table for PKs of deleted rows.
- delete all rows from the session table in the begin_upload event (session or table) - just to be sure.
- record all uploaded deletes from your session in the session table, in the trigger or in the event handler.
- filter all rows in the session table from the download_delete_cursor (EXCEPT / WHERE ... NOT IN (SELECT ...))
- delete all rows from the session table in the end_download event (session or table).
HTH
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The MobiLink Server does not filter rows from the download_delete_cursor, only the download_cursor.
If you want to filter rows from the download_delete_cursor, Volker's suggestion is a good one.
Reg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Egad! Are you saying my book is wrong? : )
"The download stream is automatically filtered to remove any rows that were just uploaded. This makes it easier to write the download scripts because you don’t have to worry about excluding those rows to reduce unnecessary network traffic — it’s done for you." - Section 7.2 How MobiLink Works
Seriously, the method you are using may be fooling MobiLink. You may need to add code to your trigger(s) to prevent them from doing [whatever it is they are doing] when they are fired by the MobiLink server; checking the user id is one method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.