We are using SQL Anywhere v12.01.3554.
What impact does changing primary key on a record have when done on remote side?
Here is our situation: 1. Record inserted into table.
INSERT INTO DBA.pi_count(company,brand,size,ticket,date_entered, time_entered,user_name,computed_cases) VALUES (30,0,0,176468,'2014-09-01 00:00','19:48:29.0','Dustyg',0)
The values for brand, size, computed cases are not known at time of insert. Primary key in this example is company, brand, size, ticket.
UPDATE DBA.pi_count SET brand=489 WHERE company=30 AND brand=0 AND size=0 AND ticket=176468
This is not what I was expecting. Can anyone provide an explantion as to what is going on here?
I am guessing that my issue is updating the primary key and this is frowned upon in a MobiLink setup so I will likely need to re-design my table to avoid doing this in the future. This is the only table in our setup where we update the primary key after initial setup.
Thanks for any help.
asked 04 Sep '14, 09:44
Your expectation is correct, just have a look at these generell MobiLink development tips in the docs
Just to add:
From MobiLink's point of view, a surrogate PK with no real meaning would certainly help to avoid the need to update a PK lateron. However, you state:
So if there's a need that these values are unique (even when not used as PK and possibly not declared as UNIQUE KEYS) and will be filled lateron - how do you make sure no two remotes can set the same unique values for different rows?
I'm just hinting at the fact that modifying PKs in a ML setup is no good but guaranteeing non-PK UNIQUE constraints in a distributed system is not that easy, either... - it might require some kind of conflict resolution, methinks.
answered 08 Sep '14, 03:50