|
Home > Archive > SQL Anywhere Mobile > July 2005 > Preventing sync with Mobilink and HotSync?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Preventing sync with Mobilink and HotSync?
|
|
|
| Scenario: using Palm device and HotSync with Mobilink (ver.
9.0.2.2451) to synchronize to an ASA consolidated back end
(ver 9.0.2.2451).
I have two versions of scripts. Version 1 used for initial
synchronization uses snapshot synchronization to download
data from a subset of the consolidated database tables. In
addition this version of scripts also calls a stored
procedure that issues a value to be used by the remote for
its global database id.
Version 2 of my scripts is used for all other
synchronizations It uploads data captured on the Palm device
and utilizes timestamp synchronization to download updated
records for those tables that were downloaded with version 1
scripts. The version 2 scripts do not call the stored
procedure that issues a global database id.
As long as synchronization is launched from within my
application everything is fine. However, if a user performs
the initial sync (from my application) captures data on the
PDA, closes my app and then simply cradles the Palm device
and presses the hot sync button (without my app running), I
notice that on the Mobilink server that the Version 1
scripts run again resulting in a new global database id
being sent to my remote device and no data being uploaded.
This results in the loss of up to a partition size of
primary key values.
While using HotSync and Mobilink, is there a way to prevent
synchronizations from occurring if they were not launched
from within my application?
Thanks in advance,
JL
| |
| David Fishburn 2005-07-11, 9:24 am |
| JL wrote in news:42cda480.6985.1681692777@sybase.com
of sybase.public.sqlanywhere.mobilink:
Right, when the application exits, the ul_synch_info struct is saved and
used later.
I would simplify your setup.
Just create 1 script version.
In the prepare_for_download
event I would call your routine to get a new
global database id (like you are currently doing).
The only addition I would make is a timestamp check.
Assuming you are passing in the LastDownload timestamp to this stored
procedure (this is the first parameter of the prepare_for_download
event), perform a simple check:
IF( @LastDownload = '1900/01/01' ) THEN
-- Go assign a global database id
END IF;
That is one way to take advantage of knowing if this is the *FIRST* time
the remote has ever synchronized.
Now you can just use 1 script version.
--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).
EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm
Developer Community / Whitepapers
http://www.ianywhere.com/developer
CaseXpress - to report bugs
http://casexpress.sybase.com
CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
|
|
|
|
|