David, Allen, Edward, thanks for the suggestions but I want to be able to sort
theB records in the exact physical order in which they occured.B Using the
port or pid numbers could potentially give me the wrong sequence should two
events occur within the same millisecond (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 to the end of the key then you can
still
sort by date/time.

In the past I've done an R%5 oconv on both the (internal)
date and time
before concatenation - this gives you a 10 digit number
regardless of
the date and time used, so no need for separators...

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
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



*B B B 
B B B  Learn and do 
*B B B  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 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
currently approximating this using a
concatenation of date and time with
millisecondsB but I'm worried about the
possibility of two phantoms
generating exactly the same key.
B
Although no
collision has been detected so far, I have added an extra
check
where after
generating the key I first test if a record with that key
exists. If so IB
increment and append aB serial number and repeat the
test
until aB unique key
is found. ItB seems to be working well but I still
think
there is a better way
to do this.
B
Thanks for any help.
B
Marco.


B  B  B 
__________________________________________________________
Sent
from Yahoo!
Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
-------
u2-users
mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit
http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit
http://listserver.u2ug.org/
-----------------------------------------------------------------------------
--------------
Please remember to recycle wherever possible. 
Reduce, reuse,
recycle, think do you need to print this e-mail?
-----------------------------------------------------------------------------
--------------
This e-mail and any attachment(s), is confidential and may be
legally privileged. It is intended solely for the addressee. If you are not
the addressee, dissemination, copying or use of this e-mail or any of its
content is prohibited and may be unlawful. If you are not the intended
recipient please inform the sender immediately and destroy the e-mail, any
attachment(s) and any copies. All liability for viruses is excluded to the
fullest extent permitted by law. It is your responsibility to scan or
otherwise check this email and any attachment(s). Unless otherwise stated (i)
views expressed in this message are those of the individual sender (ii) no
contract may be construed by this e-mail. Emails may be monitored and you are
taken to consent to this monitoring.B  

Civica Services Limited, Company No.
02374268; Civica UK Limited, Company No. 01628868
Both companies are
registered in England and Wales and each has its registered office at 2
Burston Road, Putney, London, SW15 6AR.
-----------------------------------------------------------------------------
--------------
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To
unsubscribe please visit http://listserver.u2ug.org/
__________________________________________________________
Sent from Yahoo!
Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to