|
Home > Archive > SQL Anywhere Mobile > November 2005 > Timestamp-based synchronization and download_scritp
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 |
Timestamp-based synchronization and download_scritp
|
|
| Fantom 2005-11-24, 7:23 am |
| Hi
In manual is two different examples about download_script in timestamp-based
synchronization.
last_modified > ?
or
last_modified >= ?
Second examples is ok ? This download rows from actualy and last synch ? Why
?
Fantom
| |
| Reg Domaratzki \(iAnywhere Solutions\) 2005-11-24, 11:23 am |
| You should always use last_modified >= ? in all your download events.
There are two parameters based into the download_cursor script that are read
from the upload stream. The first parameter is the last download timestamp
that represents the last time this remote user successfully downloaded data.
The second parameter is the name of the MobiLink user that is currently
synchronizing. So, assuming that the last_modified column in your table
keeps track of the last time the row was modified, adding this clause to
your download cursor will force MobiLink to download only rows that have
been modified since the last time this user successfully synchronized. In
ASA, you can maintain this column with a default value of "TIMESTAMP". For
example :
create table Parent (
parent_id integer default global autoincrement primary key,
ml_user varchar(128),
data varchar(30),
last_modified timestamp default timestamp
);
call ml_add_table_script(
'v1', 'Parent', 'download_cursor',
'select parent_id, user_id, data
from Parent
where last_modified >= ?
and ml_user = ?'
);
Note that the last_modified column is not downloaded to the remote. It only
exists on the consolidated to maintain the time the row was last modified on
the consolidated database.
--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup
iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"
"Fantom" <szczukot@skasujto.poczta.onet.pl> wrote in message
news:4385bf11@forums
-1-dub...
> Hi
> In manual is two different examples about download_script in
timestamp- based
> synchronization.
> last_modified > ?
> or
> last_modified >= ?
>
> Second examples is ok ? This download rows from actualy and last synch ?
Why
> ?
>
> Fantom
>
| |
| Fantom 2005-11-25, 7:25 am |
| > You should always use last_modified >= ? in all your download events.
In download_delete_curs
or too ?
Why many examples in manual is use 'last_modified > ?' ?
Fantom
| |
| Breck Carter [TeamSybase] 2005-11-25, 9:24 am |
| It was ">" in the documentation for years, then someone discovered
some strange situation where a row was updated with the exact same
value but was *not* included in last download stream, so the
recommendation changed to ">=". Some DBMSs have very poor timestamp
resolutions, that may have been part of the explanation.
Breck
On 25 Nov 2005 01:56:06 -0800, "Fantom"
<szczukot@skasujto.poczta.onet.pl> wrote:
>
>In download_delete_curs
or too ?
>
>Why many examples in manual is use 'last_modified > ?' ?
>
>Fantom
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
| |
| Reg Domaratzki \(iAnywhere Solutions\) 2005-11-25, 9:24 am |
| Always use last_modified >= ? in ANY event that you are coding.
--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup
iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"
"Fantom" <szczukot@skasujto.poczta.onet.pl> wrote in message
news:4386dfb6$1@foru
ms-1-dub...
>
> In download_delete_curs
or too ?
>
> Why many examples in manual is use 'last_modified > ?' ?
>
> Fantom
>
| |
| Greg Fenton 2005-11-25, 8:24 pm |
| Fantom wrote:
>
> In download_delete_curs
or too ?
Yes, if you are tracking the "last_modified" value for your deletes.
>
> Why many examples in manual is use 'last_modified > ?' ?
>
Please post the page(s) that contain such examples and we'll post
enhancement requests to the docs team.
Thanks,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
| |
| Fantom 2005-11-28, 7:25 am |
| > > Why many examples in manual is use 'last_modified > ?' ?
>
> Please post the page(s) that contain such examples and we'll post
> enhancement requests to the docs team.
But i use ASA 8.0.3 and this is old version :(
Fantom
| |
| Greg Fenton 2005-11-29, 3:24 am |
| Fantom wrote:
>
> But i use ASA 8.0.3 and this is old version :(
>
Sure, but we can confirm that they have been fixed in 9.x and/or the
quickly approaching 10.x (Jasper) release.
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
| |
| Fantom 2005-11-29, 3:24 am |
| > > But i use ASA 8.0.3 and this is old version :(
>
> Sure, but we can confirm that they have been fixed in 9.x and/or the
> quickly approaching 10.x (Jasper) release.
Where i may send this request ?
Fantom
| |
| Greg Fenton 2005-11-29, 9:29 am |
| Fantom wrote:
>
> Where i may send this request ?
>
> Fantom
Post here or send me an email (remove the _NOSPAM_) with the title of
the page(s) containing the errors you find.
If you'd like to save me some work, you could view the SQLAnywhere 9.x
documentation to see if the problems have been resolved already. You
can either download the docs as part of the SQLAnywhere 9.x Developer
Edition:
http://www.ianywhere.com/downloads/sqlany.html
or view them online:
http://www.ianywhere.com/developer/...here/index.html
Thanks in advance,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
|
|
|
|
|