Home > Archive > SQL Anywhere Mobile > November 2005 > conflict with existing rows









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 conflict with existing rows
Omri

2005-11-20, 9:23 am

Hi all,

i downloaded rows from the consolidate to the oracle and
later changed them in the ppc (primary keys like nw rows)
,later on i wanted to download those (original) rows from
the consolidate and it gave me :
in the ppc: "conflict with exusting rows"
and in the ML : "Error: [-10035] Download failed with client
error -839 "


thank you in advenced

Omri Ziv
David Fishburn

2005-11-21, 11:24 am

Omri wrote in news:43808976.38ac.1681692777@sybase.com
of sybase.public.sqlanywhere.mobilink:

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

O> i downloaded rows from the consolidate to the oracle and
O> later changed them in the ppc (primary keys like nw rows)

Let's use the MobiLink terminology.

You download rows FROM Oracle TO ASA/UL
You upload rows FROM ASA TO Oracle.

O> i downloaded rows from the consolidate to the oracle and
O> later changed them in the ppc (primary keys like nw rows)
O> ,later on i wanted to download those (original) rows from

You are intentionally updating the primary keys of the rows you
downloaded? Is that right?

Updating PKs in generally is a bad thing to do. A PK is meant to
"uniquely" identify a row, it should not have any business logic
surrounding it's value.

Why do you need to update the PKs?

O> the consolidate and it gave me :
O> in the ppc: "conflict with exusting rows"
O> and in the ML : "Error: [-10035] Download failed with client
O> error -839 "

Do you have any unique indicies on any other non-primary key columns?

--
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
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]

Omri

2005-11-22, 3:24 am

David Hi,
mobilink 9.0.2.3198
UL 9.01.175
D> Why do you need to update the PKs?
i have few PK's in the table i download one of them is
"source" so i'll know were they came from the ppc or thr
consolidate.

i forgot to say that in the ML i get : "Error: [-10035]
Download failed with client error -839 "

here is the scenario again to be clear:
1) i download rows from the consolidate
2) i change them encluding 1 PK so i'll know it's changed
from the original(means a new row).
3) i want to download the original rows again (for some
reson)
4) it gives in the ppc: conflict wit existing rows, and in
the ML :
"Error: [-10035] Download failed with client error -839 "

have a GREAT day,

Omri Ziv
Greg Fenton

2005-11-22, 11:24 am

Omri wrote:
> here is the scenario again to be clear:
> 1) i download rows from the consolidate
> 2) i change them encluding 1 PK so i'll know it's changed
> from the original(means a new row).


Why does your application need to know that the row was changed?
UltraLite and ASA remotes automatically track changes to rows in
publications and upload those changes upon synchronization.

Why change it that way? I would think that if it is "necessary", that
you are better off INSERTing a copy of the row (including the new PK)
and DELETEing the old row. In your synchronization scripts, you can
decide what to do with the DELETE (e.g. ignore it).

> 3) i want to download the original rows again (for some
> reson)


Usually would not get the "original rows" again as for 99% of tables you
will be using timestamp-based synchronization. Since the original rows
have not changed, they will not be downloaded again.

It appears to me that you are working against the design of MobiLink,
which often leads to confusion, headaches and possibly lost or incorrect
information. I suggest you explain what it is you are trying to
accomplish and why you feel it is necessary to update primary keys.
Likely we have a solution for the given problem that works within the ML
design (we've discussed hundreds of ML applications in this forum).

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Omri

2005-11-23, 7:24 am

> It appears to me that you are working against the design
> of MobiLink, which often leads to confusion, headaches
> and possibly lost or incorrect information. I suggest
> you explain what it is you are trying to accomplish and
> why you feel it is necessary to update primary keys.
> Likely we have a solution for the given problem that works
> within the ML design (we've discussed hundreds of ML
> applications in this forum).
>

i'll explain again:
i am downloading rows that actually events to take care of.
i am defining the rows tha came from the consolidate by
putting "0" in the culonm "source".
after i took care of the event i'm changing the "source"
colunm to "1" and upload it to the consolidate .(not
deleteing it because i want backup). the col "source" is PK.
but sometimes i want to download the same event again
eventhogh i change it already.
and there it gives me the error 10035 and -839.

i hope i have been clear this time .


have GREAT day,

Omri Ziv
Greg Fenton

2005-11-23, 8:24 pm

Omri wrote:
> i am defining the rows tha came from the consolidate by
> putting "0" in the culonm "source".
> after i took care of the event i'm changing the "source"
> colunm to "1" and upload it to the consolidate .(not
> deleteing it because i want backup). the col "source" is PK.


But *why* is "source" the PK ?
This is exactly what David was talking about. The PK's *only* purpose
in life is to uniquely identify a row. It should NOT contain any type
of "business logic", which your "0" and "1" values do.

Why do you feel it is necessary for "source" to be the PK? Why can it
not be a data column and have an AUTOINCREMENT or GLOBAL AUTOINCREMENT
column as the primary key (for example)?

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Omri

2005-11-24, 3:23 am


>
> Why do you feel it is necessary for "source" to be the PK?
> Why can it not be a data column and have an
> AUTOINCREMENT or GLOBAL AUTOINCREMENT column as the
> primary key (for example)?
>

because if i download the row and it again and it's been
modify it will override the changed row.

and i want to be able to do diffrent things with the
original row.
i need the option to download the row again even thogh i
change it already in the UL.


have a GREAT day
Omri Ziv
Greg Fenton

2005-11-25, 8:24 pm

Omri wrote:
>
> because if i download the row and it again and it's been
> modify it will override the changed row.
>


The modified value would be uploaded before the download phase occurs.
So the uploaded value would, in turn, be downloaded again. This is a
fundamental design of MobiLink to avoid exactly what you are trying to
avoid: changes get uploaded first, then values are downloaded.

> and i want to be able to do diffrent things with the
> original row.
> i need the option to download the row again even thogh i
> change it already in the UL.


I am still not clear as to what "do different things witht he original
row" means. In the cases where customers have tried to do what you
appear to be doing, I recommend they INSERT a new row instead of
updating the primary key.

Let me state this in no uncertain terms:

Updating primary keys is a Very Very Bad Idea

It is bad in normal client/server environments. It is extremely bad in
a distributed database.

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
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