How resolve this problem (long) - 07-06-2006 , 06:29 AM
i write this second time. I now how works scripts etc in mobilink. But i
dont know method (not code - only logic) how resolve this problem
How resolve this type of conflict :
group of rows in more than one table is "one integrity data". For example :
1) Table Document (with columns "ID_doc"-primary key and "counthistory")
2) Table History (with column "ID_doc"-foreign key, "ID_Article","quantity")
In all databases (consolidated and remotes) exists records :
Id_doc = 1, counthistory = 3
ID_Doc = 1, ID_Article = 1, quantity = 5
ID_Doc = 1, ID_Article = 2, quantity = 5
ID_Doc = 1, ID_Article = 3, quantity = 5
And two user modify this document on remote.
- delete second and third row
- adding "1" to first row
-delete first row
-change quantity where id_article = 2 (adding 1).
When i dont want resolve conflict, after two synch in consolidate database i
After first synch :
Id_doc = 1, counthistory = 1
ID_Doc = 1, ID_Article = 1, quantity = 6
ID_Doc = 1, ID_Article = 2, quantity = 5 (active = 0)
ID_Doc = 1, ID_Article = 3, quantity = 5 (active = 0)
After second synch :
Id_doc = 1, counthistory = 2
ID_Doc = 1, ID_Article = 1, quantity = 6 (active = 0)
ID_Doc = 1, ID_Article = 2, quantity = 6 (active = 0)
ID_Doc = 1, ID_Article = 3, quantity = 5 (active = 0)
This documnet is bad ! Counthistory = 2 but in history is not record. This
documnet not this same is in first or second user. How resolve this type of
conflict. I want that this document this same (not mix) who want second user
First example : when i want that second user is priorytet and his document
is ok :
- I now how resolve problem in table document - i delete record from
consolidate and insert new
- i write new record from remote and set active = 0 to first row
- i write second record from remote (old from consolidated i deleted)
After this operation i get :
Id_doc = 1, counthistory = 2 - its ok
ID_Doc = 1, ID_Article = 1, quantity = 5 (active = 0) - its ok
ID_Doc = 1, ID_Article = 2, quantity = 6 (active = 1) - its ok
ID_Doc = 1, ID_Article = 3, quantity = 5 (active = 0) - this is not ok
How i may resolve this last problem ? First user 'deleted' this record, but
second user is not deleted this record and its must active after synch. How
method i must use that i know that i must set active = 1 to this tye of
Re: How resolve this problem (long) - 07-06-2006 , 07:57 AM
Your example where counthistory is incorrect after a conflict occurs is
covered with a sample in the documentation when explaining how conflict
resolution is handled in the Contact sample.
The Contact Sample Application
Synchronizing products in the Contact sample
Although the schema is obviously different, it shows how conflict resolution
works in an example where two salesmen are both updating the number of
products available from two database. I believe the same technique can be
used on the counthistory column of the document table in your example (and
the quantity table in the history table as well if you want).
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"
"Fantom" <szczukot (AT) skasujto (DOT) poczta.onet.pl> wrote
Re: How resolve this problem (long) - 07-06-2006 , 08:08 AM
"Fantom" <szczukot (AT) skasujto (DOT) poczta.onet.pl> wrote in
news:44acf2b6$1@forums-2-dub of sybase.public.sqlanywhere.mobilink:
Before we answer can you:
1. Show us the result you want in the tables when all remotes have
2. Show us the results you are currently getting.
3. Show us what what conflict resolution scripts you have written so
far, that give you the results you are seeing.
4. Below you mention what user 1 does, and what user 2 does. Can you
actually show the changes instead of saying them, it will help us
visualize it better.
5. Show us the state of the consolidated after EACH remote database
synchronizes. Indicate whether the end result is GOOD or BAD. If
bad tell us why it is bad and what you wanted. Again, do this
visually like you have done for other comments:
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).
EBFs and Maintenance Releases
Developer Community / Whitepapers
CaseXpress - to report bugs
CodeXchange - Free samples
Re: How resolve this problem (long) - 07-07-2006 , 06:08 AM
problem. I dont want, that data in database is 'mixed' from users. I want
that this data is all get from one user. And from another users is removed -
replaced new 'group of data'
Re: How resolve this problem (long) - 07-20-2006 , 04:11 AM
If you want "that this data is all get from one user" there is one method:
You must produce Resolve_conflict event for EACH record in changed document
(both header and details), then you can write handle-procedure which right
update this doc (write/decline one/all records - how do you want).
Now this problems happened only for rows changed by second user. Second user
know nothing about first user's work. Cause in upload stream will no
recordrs modified only by first user, and resolve conflict event not
happens. If you'd force update all of document records (header too), then
you'd can solve what record is correct in resolve_conflict handler. This
will grow upload stream-size, but help you get right records.
(ASA 188.8.131.5231, MW CW 9.2)
"Fantom" <szczukot (AT) skasujto (DOT) poczta.onet.pl> ???????/???????? ? ????????
?????????: news:44ae40b4$1 (AT) forums-1-dub (DOT) ..