Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Chris J
  Where is Chris J?
 
 United Kingdom
 Chris J
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 Tags
Subject: RE: "Uniqueness violated" on SYS(2015)
Thread ID: 248724 Message ID: 249142 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Tuesday, December 29, 2009 11:44:45 AM         
   


> There is no guarantee that SYS(2015) will return unique value, esp. when your application work on several computers.
> That is why I suggested you to use Integer AUTOINC or GUID.

I did check the original table with the value in the debugger, and there wasn't a duplicate in there. The routine was running on only one computer (my dev box), and the documentation states that even those requests within the same millisecond interval get unique values (I've seen the documentation be wrong on other counts before, though).

Changing to autoinc or GUID isn't possible:
* The app itself dates back at least 10 years (we inherited it earlier this year)
* The SYS(2015)s are deeply entrenched in the system: every table has a candidate index on a SYS(2015) field, every relation depends on them, and pretty much every query not written by us relies on it in some way
* This program is for a bulk import, and we're already courting the client for a rewrite of this monstrosity

Given those, there's no hope of getting such a change signed off, so this particular cancer is inoperable. In the short term, I've tweaked the one affected table to use a default value of SYS(2015) on that field, and the problem hasn't resurfaced since. The defects in the data to be imported are a bigger concern at the moment.

Thanks anyway.

ENTIRE THREAD

"Uniqueness violated" on SYS(2015) Posted by Chris J @ 12/22/2009 5:15:18 PM
RE: "Uniqueness violated" on SYS(2015) Posted by Borislav Borissov @ 12/22/2009 5:37:31 PM
RE: "Uniqueness violated" on SYS(2015) Posted by Chris J @ 12/29/2009 11:44:45 AM
RE: "Uniqueness violated" on SYS(2015) Posted by Anders Altberg @ 12/29/2009 3:57:23 PM
RE: "Uniqueness violated" on SYS(2015) Posted by Ciprian Zaharia @ 12/22/2009 8:37:07 PM
RE: "Uniqueness violated" on SYS(2015) Posted by Jun Tangunan @ 12/23/2009 1:15:49 AM
RE: "Uniqueness violated" on SYS(2015) Posted by Anatoliy Mogylevets @ 12/23/2009 5:39:50 PM
RE: "Uniqueness violated" on SYS(2015) Posted by Anders Altberg @ 12/25/2009 6:35:13 PM