In message [EMAIL PROTECTED], Glen Batchelor
[EMAIL PROTECTED] writes
-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
-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
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
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
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
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
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
.
--- 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
-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
] 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
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
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
Marco,
I have used similar processes in the past, but also have appended port
number to the beginning of the key. Separating the fields with '*' so the
date and time can also be used as a time stamp rather than duplicate the
same info in the record.
Cheers,
David Murray
*
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
...
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
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
Setup a loop
This assumes you've already set up ID with the date:time
I=0
LOOP
I += 1
WRITE.ID = ID : '*' : I
READV JUST.CHECKING FROM FILE.NAME, WRITE.ID, 0 ELSE
WRITE REC ON FILE.NAME, WRITE.ID
EXIT
END
REPEAT
This will always append *1 to the end of the ID unless it already
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
(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
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
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
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
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
' 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
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
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
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
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
Hi Marco - this is in fact the way I update files on very busy systems - we are
getting say 30 hits per second and for logging with unique keys I have in the
past used the date():system(12):endbit where endbit is incremented after
doing a readvu to check if it exists or not. (as per your
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!
*
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
-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
] Guaranteed unique sequential keys
I had this issue where I was overwriting files and found out that I need
to used @ rather than the (). I know there a difference in using
time/date where :
@DATE [EMAIL PROTECTED] is when the user/phantom was logged in
DATE() {TIME()} is the actually time and date
I
-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
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/
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,
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
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
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
You'll need a central key generator to manage high resolution sortable
sequential keys. You can use whatever connection medium is feasible and let
a single process/phantom generate the keys in numerical order. The problem
with using a key generator like this is that you could easily produce a
40 matches
Mail list logo