dbTalk Databases Forums  

Resolve conflict

sybase.public.sqlanywhere.mobilink sybase.public.sqlanywhere.mobilink


Discuss Resolve conflict in the sybase.public.sqlanywhere.mobilink forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
R.Brouwer
 
Posts: n/a

Default Resolve conflict - 02-16-2006 , 06:36 AM






Is there a simple way when resolving conflicts, the remote
who modified
a record the last time wins the conflict.
Another thing, what if the consolidate modified the record
later, in this case the record shouldn't be updated.

TIA

Reply With Quote
  #2  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 08:11 AM






See my book, or the Help:

MobiLink Administration Guide

Synchronization Techniques

Handling conflicts

Resolving conflicts

Resolving conflicts with resolve_conflict scripts

Breck

On 16 Feb 2006 04:36:28 -0800, R.Brouwer wrote:

Quote:
Is there a simple way when resolving conflicts, the remote
who modified
a record the last time wins the conflict.
Another thing, what if the consolidate modified the record
later, in this case the record shouldn't be updated.

TIA
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/AS.../risingroad-20
bcarter (AT) risingroad (DOT) com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com


Reply With Quote
  #3  
Old   
Reg Domaratzki \(iAnywhere Solutions\)
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 08:27 AM



Quote:
Is there a simple way when resolving conflicts, the remote
who modified
a record the last time wins the conflict.
Do you mean the time that the record was updated at the remote, or the time
that the update was synchronized to the consolidated?

Quote:
Another thing, what if the consolidate modified the record
later, in this case the record shouldn't be updated.
Are you trying to stop ALL updates to the table on the consolidated? I'm a
little unclear what you're asking here.

--
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/swd/base.do
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"


<R.Brouwer> wrote

Quote:
Is there a simple way when resolving conflicts, the remote
who modified
a record the last time wins the conflict.
Another thing, what if the consolidate modified the record
later, in this case the record shouldn't be updated.

TIA



Reply With Quote
  #4  
Old   
R.Brouwer
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 08:36 AM



Quote:
See my book, or the Help:

MobiLink Administration Guide

Synchronization Techniques

Handling conflicts

Resolving conflicts

Resolving conflicts with resolve_conflict scripts

Breck

On 16 Feb 2006 04:36:28 -0800, R.Brouwer wrote:

Is there a simple way when resolving conflicts, the
remote >who modified
a record the last time wins the conflict.
Another thing, what if the consolidate modified the
record >later, in this case the record shouldn't be
updated.
TIA

--
SQL Anywhere Studio 9 Developer's Guide
Buy the book:

http://www.amazon.com/exec/obidos/AS.../risingroad-20
bcarter (AT) risingroad (DOT) com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
I implemented the upload_fetch, upload_old_row_insert and
the upload_new_row_insert.
When i started at the resolve_conflict i realised i need the
modify datetime for the uploaded row and the modify datetime
of the row being updated in the consolidated database.
The helpfiles aren't helping me out there (ea..probably i
misunderstand something)

TIA


Reply With Quote
  #5  
Old   
David Fishburn
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 09:10 AM



R.Brouwer wrote in news:43f46297.77f.1681692777 (AT) sybase (DOT) com
of sybase.public.sqlanywhere.mobilink:

RB> Is there a simple way when resolving conflicts, the remote
RB> who modified
RB> a record the last time wins the conflict.
RB> Another thing, what if the consolidate modified the record
RB> later, in this case the record shouldn't be updated.

Please ALWAYS include version and MORE importantly BUILD number
with EACH post (dbeng9 -v).

I just realized our documentation does not really provide any examples
of how to perform the standard timestamp based conflict resolution
rules. That is disappointing. I will include a sample to the doc team
to include it. That will be in our next major release of SA.

There are a number of ways to do what you ask but each of them requires
you to write some code.

If your consolidated database is ASA (please include this information
with future posts) then you have a few more options.

I personally favour this approach (from the 9.0.2 docs):
MobiLink Administration Guide
Synchronization Techniques
Handling conflicts
Resolving conflicts
Resolving conflicts with upload_update scripts

Okay, this sample DOES show timestamp based resolution, but it was very
difficult to find.

Read through that section, this part is of special interest:
IF( @@rowcount = 0 ) THEN

--
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
http://ianywhere.codexchange.sybase....ctDocumentList


Reply With Quote
  #6  
Old   
R.Brouwer
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 09:13 AM



Quote:
Is there a simple way when resolving conflicts, the
remote who modified
a record the last time wins the conflict.

Do you mean the time that the record was updated at the
remote, or the time that the update was synchronized to
the consolidated?

Another thing, what if the consolidate modified the
record later, in this case the record shouldn't be
updated.

Are you trying to stop ALL updates to the table on the
consolidated? I'm a little unclear what you're asking
here.

--
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/swd/base.do
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"


R.Brouwer> wrote in message
news:43f46297.77f.1681692777 (AT) sybase (DOT) com... Is there a
simple way when resolving conflicts, the remote who
modified a record the last time wins the conflict.
Another thing, what if the consolidate modified the
record later, in this case the record shouldn't be
updated.
TIA


First of all thanks for the fast reply.
Situation, 2 remote databases : R1 and R2 (Cosolidate C)
When R1 modifies rec A at a given time, R2 modifies the same
column at a later time.
When R2 synchronize, Row A will be updated on C.
Now when R1 synchronizes the row A...it was modified
earlyer, so i don't want it to update. How can i accomplish
this?
What will happen if the row on the consolidated database is
modified later than R2 modified it?

TIA





(Version Info : SQL Anywhere 9.0.2.3249)


Reply With Quote
  #7  
Old   
R.Brouwer
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 10:13 AM



Quote:
R.Brouwer wrote in news:43f46297.77f.1681692777 (AT) sybase (DOT) com
of sybase.public.sqlanywhere.mobilink:

RB> Is there a simple way when resolving conflicts, the
remote RB> who modified
RB> a record the last time wins the conflict.
RB> Another thing, what if the consolidate modified the
record RB> later, in this case the record shouldn't be
updated.

Please ALWAYS include version and MORE importantly BUILD
number with EACH post (dbeng9 -v).

I just realized our documentation does not really provide
any examples of how to perform the standard timestamp
based conflict resolution rules. That is disappointing.
I will include a sample to the doc team to include it.
That will be in our next major release of SA.

There are a number of ways to do what you ask but each of
them requires you to write some code.

If your consolidated database is ASA (please include this
information with future posts) then you have a few more
options.

I personally favour this approach (from the 9.0.2 docs):
MobiLink Administration Guide
Synchronization Techniques
Handling conflicts
Resolving conflicts
Resolving conflicts with upload_update
scripts

Okay, this sample DOES show timestamp based resolution,
but it was very difficult to find.

Read through that section, this part is of special
interest:
IF( @@rowcount = 0 ) THEN

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

http://ianywhere.codexchange.sybase....ctDocumentList

I'm running SQL Anywhere v9.0.2.3249

I don't get the upload_update example, first of all i count
10 arguments in the stored procedure 'sp_update_customer'
and I count 6 arguments in the call to the stored procedure
in the upload_update event (call
sp_update_customer(.......))
Maybe this is correct, my knowledge about stored procedures
and triggers isn't that good.
If I see the explanation of the upload_update table event I
miss aruments.
Probably I miss something here.

In the update_old/new_row_insert events I get the old/new
row uploaded from the client.
How can I find out when they where modified?
Do I have to insert a timestamp (default timestamp) column
in every table I want to synchronize on all remote databases
(like I have to do on the consolidated database for
time-synchronization)?

TIA


Reply With Quote
  #8  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 10:15 AM



It's a dangerous game, relying on datetime values set on a remote
database where you have no control overy the clock setting

Breck

On 16 Feb 2006 07:10:37 -0800, David Fishburn
<fishburn_spam (AT) off (DOT) ianywhere.com> wrote:

Quote:
R.Brouwer wrote in news:43f46297.77f.1681692777 (AT) sybase (DOT) com
of sybase.public.sqlanywhere.mobilink:

RB> Is there a simple way when resolving conflicts, the remote
RB> who modified
RB> a record the last time wins the conflict.
RB> Another thing, what if the consolidate modified the record
RB> later, in this case the record shouldn't be updated.

Please ALWAYS include version and MORE importantly BUILD number
with EACH post (dbeng9 -v).

I just realized our documentation does not really provide any examples
of how to perform the standard timestamp based conflict resolution
rules. That is disappointing. I will include a sample to the doc team
to include it. That will be in our next major release of SA.

There are a number of ways to do what you ask but each of them requires
you to write some code.

If your consolidated database is ASA (please include this information
with future posts) then you have a few more options.

I personally favour this approach (from the 9.0.2 docs):
MobiLink Administration Guide
Synchronization Techniques
Handling conflicts
Resolving conflicts
Resolving conflicts with upload_update scripts

Okay, this sample DOES show timestamp based resolution, but it was very
difficult to find.

Read through that section, this part is of special interest:
IF( @@rowcount = 0 ) THEN
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/AS.../risingroad-20
bcarter (AT) risingroad (DOT) com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com


Reply With Quote
  #9  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 10:18 AM



The example's wrong, you need a matching CALL.

Yes, you need a column to keep track of row timestamps. Like I said
earlier, beware of remote computers with wonky clock settings.

Breck

On 16 Feb 2006 08:13:19 -0800, R.Brouwer wrote:

Quote:
R.Brouwer wrote in news:43f46297.77f.1681692777 (AT) sybase (DOT) com
of sybase.public.sqlanywhere.mobilink:

RB> Is there a simple way when resolving conflicts, the
remote RB> who modified
RB> a record the last time wins the conflict.
RB> Another thing, what if the consolidate modified the
record RB> later, in this case the record shouldn't be
updated.

Please ALWAYS include version and MORE importantly BUILD
number with EACH post (dbeng9 -v).

I just realized our documentation does not really provide
any examples of how to perform the standard timestamp
based conflict resolution rules. That is disappointing.
I will include a sample to the doc team to include it.
That will be in our next major release of SA.

There are a number of ways to do what you ask but each of
them requires you to write some code.

If your consolidated database is ASA (please include this
information with future posts) then you have a few more
options.

I personally favour this approach (from the 9.0.2 docs):
MobiLink Administration Guide
Synchronization Techniques
Handling conflicts
Resolving conflicts
Resolving conflicts with upload_update
scripts

Okay, this sample DOES show timestamp based resolution,
but it was very difficult to find.

Read through that section, this part is of special
interest:
IF( @@rowcount = 0 ) THEN

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

http://ianywhere.codexchange.sybase....ctDocumentList


I'm running SQL Anywhere v9.0.2.3249

I don't get the upload_update example, first of all i count
10 arguments in the stored procedure 'sp_update_customer'
and I count 6 arguments in the call to the stored procedure
in the upload_update event (call
sp_update_customer(.......))
Maybe this is correct, my knowledge about stored procedures
and triggers isn't that good.
If I see the explanation of the upload_update table event I
miss aruments.
Probably I miss something here.

In the update_old/new_row_insert events I get the old/new
row uploaded from the client.
How can I find out when they where modified?
Do I have to insert a timestamp (default timestamp) column
in every table I want to synchronize on all remote databases
(like I have to do on the consolidated database for
time-synchronization)?

TIA
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/AS.../risingroad-20
bcarter (AT) risingroad (DOT) com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com


Reply With Quote
  #10  
Old   
R.Brouwer
 
Posts: n/a

Default Re: Resolve conflict - 02-16-2006 , 10:41 AM



Quote:
The example's wrong, you need a matching CALL.

Yes, you need a column to keep track of row timestamps.
Like I said earlier, beware of remote computers with wonky
clock settings.

Breck

On 16 Feb 2006 08:13:19 -0800, R.Brouwer wrote:

R.Brouwer wrote in
news:43f46297.77f.1681692777 (AT) sybase (DOT) com >> of
sybase.public.sqlanywhere.mobilink:
RB> Is there a simple way when resolving conflicts, the
remote RB> who modified
RB> a record the last time wins the conflict.
RB> Another thing, what if the consolidate modified the
record RB> later, in this case the record shouldn't be
updated.

Please ALWAYS include version and MORE importantly
BUILD >> number with EACH post (dbeng9 -v).

I just realized our documentation does not really
provide >> any examples of how to perform the standard
timestamp >> based conflict resolution rules. That is
disappointing. >> I will include a sample to the doc team
to include it. >> That will be in our next major release
of SA.
There are a number of ways to do what you ask but each
of >> them requires you to write some code.

If your consolidated database is ASA (please include
this >> information with future posts) then you have a few
more >> options.

I personally favour this approach (from the 9.0.2
docs): >> MobiLink Administration Guide
Synchronization Techniques
Handling conflicts
Resolving conflicts
Resolving conflicts with upload_update
scripts

Okay, this sample DOES show timestamp based resolution,
but it was very difficult to find.

Read through that section, this part is of special
interest:
IF( @@rowcount = 0 ) THEN

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

http://ianywhere.codexchange.sybase....vlets/ProjectD
ocumentList

I'm running SQL Anywhere v9.0.2.3249

I don't get the upload_update example, first of all i
count >10 arguments in the stored procedure
'sp_update_customer' >and I count 6 arguments in the call
to the stored procedure >in the upload_update event (call
sp_update_customer(.......))
Maybe this is correct, my knowledge about stored
procedures >and triggers isn't that good.
If I see the explanation of the upload_update table event
I >miss aruments.
Probably I miss something here.

In the update_old/new_row_insert events I get the old/new
row uploaded from the client.
How can I find out when they where modified?
Do I have to insert a timestamp (default timestamp)
column >in every table I want to synchronize on all remote
databases >(like I have to do on the consolidated database
for >time-synchronization)?

TIA

--
SQL Anywhere Studio 9 Developer's Guide
Buy the book:

http://www.amazon.com/exec/obidos/AS.../risingroad-20
bcarter (AT) risingroad (DOT) com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
Hi Breck,

Yes didn't even think about the clock settings...but you
have a solid rock point there.
How can I solve this little problem?
At this point I can say the last one who synchronizes wins
the game.
Or are there any other solutions?

TIA, Remco


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.