![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 : Document : Id_doc = 1, counthistory = 3 History : 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. First user - delete second and third row - adding "1" to first row Second user -delete first row -change quantity where id_article = 2 (adding 1). When i dont want resolve conflict, after two synch in consolidate database i get : After first synch : Document : Id_doc = 1, counthistory = 1 History : 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 : Document : Id_doc = 1, counthistory = 2 History : 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 (or first 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 : Document : Id_doc = 1, counthistory = 2 - its ok History : 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 record ? Fantom |
#3
| |||
| |||
|
|
Document : Id_doc = 1, counthistory = 1 History : 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) |
#4
| |||
| |||
|
|
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. MobiLink Tutorials The Contact Sample Application Synchronization 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). |
#5
| |||
| |||
|
|
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. MobiLink Tutorials The Contact Sample Application Synchronization 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). I see this example before i write first post. This method is not resolve my 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' Fantom |
![]() |
| Thread Tools | |
| Display Modes | |
| |