Re: [U2] Guaranteed unique sequential keys

2008-04-30 Thread Anthony W. Youngman
unique sequential keys In message [EMAIL PROTECTED], Glen B [EMAIL PROTECTED] writes It's not overkill if you need a multi-app/multi-process service that offers a single source for sequential keys. The other option is disk file locking. Any way you look at it, you have to go to one place for the key

RE: [U2] Guaranteed unique sequential keys

2008-04-28 Thread Glen Batchelor
-Original Message- From: [EMAIL PROTECTED] [mailto:owner-u2- [EMAIL PROTECTED] On Behalf Of Anthony W. Youngman Sent: Saturday, April 26, 2008 9:14 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Guaranteed unique sequential keys In message [EMAIL PROTECTED], Glen B [EMAIL

RE: [U2] Guaranteed unique sequential keys

2008-04-28 Thread Boydell, Stuart
What is the most reliable way to generate unique sequential keys without having to resort to a record on disk updated through readu/write? Sounds like you want to call a UUID generator. The keys don't have to be contiguous but only be sortable in the order in which they were generated by several

Re: [U2] Guaranteed unique sequential keys

2008-04-26 Thread Anthony W. Youngman
In message [EMAIL PROTECTED], Glen B [EMAIL PROTECTED] writes It's not overkill if you need a multi-app/multi-process service that offers a single source for sequential keys. The other option is disk file locking. Any way you look at it, you have to go to one place for the key. Don't relay on

RE: [U2] Guaranteed unique sequential keys

2008-04-25 Thread Marco Manyevere
there would be no need for extra IOs and no bottlenecks on a syncronisation key. --- On Fri, 25/4/08, Glen B [EMAIL PROTECTED] wrote: From: Glen B [EMAIL PROTECTED] Subject: RE: [U2] Guaranteed unique sequential keys To: u2-users@listserver.u2ug.org Date: Friday, 25

Re: [U2] Guaranteed unique sequential keys

2008-04-25 Thread Martin Phillips
Apologies if this has already been said but I have not been following this thread too closely. D3 has a SYSTEM(19) function that does what you are wanting, returning the date/time with a suffix added if any user has already generated the same key. Unfortunately, UV implements SYSTEM(19) as

Re: [U2] Guaranteed unique sequential keys

2008-04-25 Thread john reid
there would be no need for extra IOs and no bottlenecks on a syncronisation key. --- On Fri, 25/4/08, Glen B [EMAIL PROTECTED] wrote: From: Glen B [EMAIL PROTECTED] Subject: RE: [U2] Guaranteed unique sequential keys To: u2-users@listserver.u2ug.org Date: Friday, 25 April

Re: [U2] Guaranteed unique sequential keys

2008-04-25 Thread Adrian Merrall
. --- On Fri, 25/4/08, Glen B [EMAIL PROTECTED] wrote: From: Glen B [EMAIL PROTECTED] Subject: RE: [U2] Guaranteed unique sequential keys To: u2-users@listserver.u2ug.org Date: Friday, 25 April, 2008, 5:30 AM You'll need a central key generator to manage high resolution

RE: [U2] Guaranteed unique sequential keys

2008-04-25 Thread Glen B
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Adrian Merrall Sent: Friday, April 25, 2008 8:07 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Guaranteed unique sequential keys On Fri, Apr 25, 2008 at 10:19 PM, Marco Manyevere [EMAIL

RE: [U2] Guaranteed unique sequential keys

2008-04-25 Thread Marc Harbeson
] Guaranteed unique sequential keys -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Adrian Merrall Sent: Friday, April 25, 2008 8:07 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Guaranteed unique sequential keys On Fri, Apr 25, 2008 at 10:19 PM

RE: [U2] Guaranteed unique sequential keys

2008-04-25 Thread Colin Alfke
I believe we use a large pseudo random number as the key and put the time/date stamp in a log file. Your keys won't have the information in them about the sequence (although some may find that a better solution - let's not go there); however, a simply join/translate will get that for you. You can

Re: [U2] Guaranteed unique sequential keys

2008-04-25 Thread Rex Gozar
Marco, Have all the phantoms use a function or subroutine to get the next id based on the current system milliseconds. Use a semaphore lock to keep it singleton. Add a NAP statement so the next time it's run you're sure to get a different millisecond count -- note that many systems won't

[U2] Guaranteed unique sequential keys

2008-04-24 Thread Marco Manyevere
What is the most reliable way to generate unique sequential keys without having to resort to a record on disk updated through readu/write? The keys don't have to be contiguous but only be sortable in the order in which they were generated by several phantom processes running concurrently. I'm

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread David Murray
* Learn and do * Excel and share http://u2blog.org -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco Manyevere Sent: Thursday, April 24, 2008 5:55 AM To: u2-users@listserver.u2ug.org Subject: [U2] Guaranteed unique sequential keys What

Re: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Allen Egerton
Marco Manyevere wrote: What is the most reliable way to generate unique sequential keys without having to resort to a record on disk updated through readu/write? The keys don't have to be contiguous but only be sortable in the order in which they were generated by several phantom processes

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Edward Brown
... Edward -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Murray Sent: 24 April 2008 11:53 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Guaranteed unique sequential keys Marco, I have used similar processes in the past, but also have appended port

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Tom Whitmore
If you use @USERNO, instead of the pid, it will be OS independent. Tom Whitmore -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Allen Egerton Sent: Thursday, April 24, 2008 6:58 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Guaranteed unique

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Allen E. Elwood
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Marco Manyevere Sent: Thursday, April 24, 2008 02:55 To: u2-users@listserver.u2ug.org Subject: [U2] Guaranteed unique sequential keys What is the most reliable way to generate unique sequential keys without having to resort to a record on disk

Re: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Marco Manyevere
that this is not possible). Regards, Marco. - Original Message From: Edward Brown [EMAIL PROTECTED] To: u2-users@listserver.u2ug.org Sent: Thursday, 24 April, 2008 1:07:13 PM Subject: RE: [U2] Guaranteed unique sequential keys Of course if the port number is added to the end of the key

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Edward Brown
(unless it is ruled out that this is not possible). Regards, Marco. - Original Message From: Edward Brown [EMAIL PROTECTED] To: u2-users@listserver.u2ug.org Sent: Thursday, 24 April, 2008 1:07:13 PM Subject: RE: [U2] Guaranteed unique sequential keys Of course if the port number is added

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread David Wolverton
does not. Darn it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco Manyevere Sent: Thursday, April 24, 2008 7:47 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Guaranteed unique sequential keys David, Allen, Edward, thanks

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Marc Harbeson
a next number array. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco Manyevere Sent: Thursday, April 24, 2008 8:47 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Guaranteed unique sequential keys David, Allen, Edward, thanks

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread David Wolverton
And on this part ... potentially give me the wrong sequence should two events occur within the same millisecond (unless it is ruled out that this is not possible). I was only partially kidding about the 'two items a second' thing -- even if this were NOT possible today, in the lifetime of

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Edward Brown
But common wouldn't help here as it can't be shared between processes? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Harbeson Sent: 24 April 2008 14:42 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Guaranteed unique sequential keys No, fast

Re: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Marco Manyevere
' Unique ID generator in their SYSTEM() selectiosn... U2 does not.B Darn it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco Manyevere Sent: Thursday, April 24, 2008 7:47 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Guaranteed unique

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Timothy Snyder
D3 has a 'System-Wide' Unique ID generator in their SYSTEM() selectiosn... U2 does not. Darn it. Ah, but nothing's free. To ensure uniqueness, there needs to be some sort of negotiation. Years ago I worked on a Sequoia system running Pick O/A. We were happy to see SYSTEM(19), which

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Edward Brown
others come up with ideas. Edward -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 24 April 2008 15:44 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Guaranteed unique sequential keys Not that I know all that much about

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Marc Harbeson
True. :-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edward Brown Sent: Thursday, April 24, 2008 10:07 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Guaranteed unique sequential keys But common wouldn't help here as it can't be shared

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Allen E. Elwood
You need to re-read my solution, it will do exactly what you want. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Marco Manyevere Sent: Thursday, April 24, 2008 05:47 To: u2-users@listserver.u2ug.org Subject: Re: [U2] Guaranteed unique sequential keys

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Symeon Breen
April 2008 10:55 To: u2-users@listserver.u2ug.org Subject: [U2] Guaranteed unique sequential keys What is the most reliable way to generate unique sequential keys without having to resort to a record on disk updated through readu/write? The keys don't have to be contiguous but only be sortable

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread David Wolverton
OOPS!! I forgot the RELEASE on the THEN!! Bad David!! BASE.KEY = KEY SEQCNT = 1 DO.WRITE = 0 LOOP UNTIL DO.WRITE READVU TESTINGIT FROM FILENAME, KEY, 0 LOCKED * No need to wait, Drop To Key Update END THEN RELEASE FILENAME, KEY ; VERY NEEDED! *

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Ron Hutchings
Use the suggestion about a read to verify the non-existence of the record and then loop around until the time() function changes to a unique id. From: [EMAIL PROTECTED] To: u2-users@listserver.u2ug.org Subject: RE: [U2] Guaranteed unique sequential keys Date: Thu, 24 Apr 2008 11:02:26 -0500

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread David Wolverton
-users@listserver.u2ug.org Subject: RE: [U2] Guaranteed unique sequential keys Use the suggestion about a read to verify the non-existence of the record and then loop around until the time() function changes to a unique id. --- u2-users mailing list u2-users@listserver.u2ug.org

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Marc Harbeson
) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco Manyevere Sent: Thursday, April 24, 2008 5:55 AM To: u2-users@listserver.u2ug.org Subject: [U2] Guaranteed unique sequential keys What is the most reliable way to generate unique sequential keys without

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Marc Harbeson
-users@listserver.u2ug.org Subject: RE: [U2] Guaranteed unique sequential keys OOPS!! I forgot the RELEASE on the THEN!! Bad David!! BASE.KEY = KEY SEQCNT = 1 DO.WRITE = 0 LOOP UNTIL DO.WRITE READVU TESTINGIT FROM FILENAME, KEY, 0 LOCKED * No need to wait, Drop To Key Update END

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Ray Wurlod
I forgot to mention in my previous post is that a WRITE of a new record into a UniVerse/SQL table is regarded as an INSERT. So the new key generation will occur. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/

Re: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Ray Wurlod
Here is a UniVerse/SQL answer. Create the primary key with a default value of NEXT AVAILABLE. CREATE TABLE MyTable ( MyKey INTEGER NOT NULL PRIMARY KEY DEFAULT NEXT AVAILABLE, Column1 VARCHAR, Column2 VARCHAR, Column3 VARCHAR NOT NULL MULTIVALUED, Column4 VARCHAR MULTIVALUED,

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Stevenson, Charles
That's very good, but DICT NEXT.AVAILABLE sure is ugly. It means you can't make a dictionary read-only. Dictionaries should be under source control. And a data file can have multiple dictionaries. A better answer would be to embed the next-id in the file header. Then give a utility to edit it

Re: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Louie Bergsagel
I'm surprised to see most people suggesting a date time stamp for the record key. Isn't a sequential number the ideal? Which hashes better? I like Mr. Stevenson's suggestion of storing a next-available key in the file header. It could be configurable by file to be an integer, or some of the

Re: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Ray Wurlod
How to write? I'd probably go for INSERT statements via the pre-defined @HSTMT statement handle and the BCI function SQLExecDirect. That's because the WRITE statement requires a key value. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit

RE: [U2] Guaranteed unique sequential keys

2008-04-24 Thread Glen B
] Guaranteed unique sequential keys What is the most reliable way to generate unique sequential keys without having to resort to a record on disk updated through readu/write? The keys don't have to be contiguous but only be sortable in the order in which they were generated by several phantom