Home > Archive > SQL Anywhere Mobile > November 2005 > Upload of inserts - affecting timestamp-based syncronization









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 Upload of inserts - affecting timestamp-based syncronization
Brian Greiman

2005-11-17, 11:24 am

ASA v9.01.2052

We have a table called company that is setup with a column called
modified_datetime default timestamp. This column is used to determine what
rows to download to remote users.

The following occurs:
1. Remote user 1 inserts a new row into company table (modified_datetime
column gets updated to 12:05:15.
2. At 4:15 pm that day, mobilink is run and row is uploaded to consolidated.
Consolidated database does not update modified_datetime column (shouldn't
it?).
3. Remote user 2 syncs at 3:15 pm and again at 4:30 pm. Remote user 2 is
subscribed to company table but never receives new row inserted by 1 because
at 3:15, row was not available to download from consolidated db and at 4:30
row was available, but modified_datetime value was 12:05:15 and he/she had
synched at a later time, so the script said to not download this row.

It is my understanding that modified_datetime column is updated in insert
event on remote database, but does not get updated with sync? Is this
correct. Shouldn't it get updated when insert happens in MobiLink server?
Is there some setting I am missing or something I am doing wrong.

Thanks for any guidance!!

Brian


Reg Domaratzki \(iAnywhere Solutions\)

2005-11-17, 11:24 am

The modified_datetime column should not exist at the remote. It's only
purpose is to keep track of the last time the row was modified on the
CONSOLIDATED, so when the column is updated at the remote, it's causing the
problems that you are seeing. Also, the "default timestamp" default will
not be used if you specify a value, which is why the value isn't being
updated on upload.

--
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"


"Brian Greiman" <bgreiman@bernicks.com> wrote in message
news:437caa81$1@foru
ms-1-dub...
> ASA v9.01.2052
>
> We have a table called company that is setup with a column called
> modified_datetime default timestamp. This column is used to determine

what
> rows to download to remote users.
>
> The following occurs:
> 1. Remote user 1 inserts a new row into company table (modified_datetime
> column gets updated to 12:05:15.
> 2. At 4:15 pm that day, mobilink is run and row is uploaded to

consolidated.
> Consolidated database does not update modified_datetime column (shouldn't
> it?).
> 3. Remote user 2 syncs at 3:15 pm and again at 4:30 pm. Remote user 2 is
> subscribed to company table but never receives new row inserted by 1

because
> at 3:15, row was not available to download from consolidated db and at

4:30
> row was available, but modified_datetime value was 12:05:15 and he/she had
> synched at a later time, so the script said to not download this row.
>
> It is my understanding that modified_datetime column is updated in insert
> event on remote database, but does not get updated with sync? Is this
> correct. Shouldn't it get updated when insert happens in MobiLink server?
> Is there some setting I am missing or something I am doing wrong.
>
> Thanks for any guidance!!
>
> Brian
>
>



Breck Carter [TeamSybase]

2005-11-17, 11:24 am

Datetime values calculated on a *remote* computer should never be used
in comparisons performed on the *consolidated*. You cannot trust the
datetime settings on remote computers. For example, the last_download
datetime that MobiLink passes around is calculated on the
consolidated, even though the value is passed up and down during
synchronization, and is stored in the remote SYSSYNC table.

Timestamp-based synchronization uses DEFAULT TIMESTAMP columns on the
consolidated database. These columns are not included in the
publications on the remote (the columns often do not even exist on the
remote) so values are not uploaded from the remotes. Instead, the
values are set on the *consolidated* when uploaded rows are inserted
or updated. In your example, the row uploaded from remote 1 would have
the datetime set to 4:15, and therefore the row *would* be downloaded
to remote 2 at 4:30.

Breck


On 17 Nov 2005 08:06:25 -0800, "Brian Greiman" <bgreiman@bernicks.com>
wrote:

>ASA v9.01.2052
>
>We have a table called company that is setup with a column called
>modified_datetime default timestamp. This column is used to determine what
>rows to download to remote users.
>
>The following occurs:
>1. Remote user 1 inserts a new row into company table (modified_datetime
>column gets updated to 12:05:15.
>2. At 4:15 pm that day, mobilink is run and row is uploaded to consolidated.
>Consolidated database does not update modified_datetime column (shouldn't
>it?).
>3. Remote user 2 syncs at 3:15 pm and again at 4:30 pm. Remote user 2 is
>subscribed to company table but never receives new row inserted by 1 because
>at 3:15, row was not available to download from consolidated db and at 4:30
>row was available, but modified_datetime value was 12:05:15 and he/she had
>synched at a later time, so the script said to not download this row.
>
>It is my understanding that modified_datetime column is updated in insert
>event on remote database, but does not get updated with sync? Is this
>correct. Shouldn't it get updated when insert happens in MobiLink server?
>Is there some setting I am missing or something I am doing wrong.
>
>Thanks for any guidance!!
>
>Brian
>


--
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
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com