× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: duplicate record Id's in multi user environment
  • From: bvining@xxxxxxxxxxxx
  • Date: Tue, 17 Oct 00 11:51:44 CDT

With all the various notes on this topic I'm not sure which Timestamp
click is being refered to in the attached; but if it's the result of
the RPG TIME operation then duplicate values are certainly possible.
If, on the other hand, this is an MI timestamp obtained through an
instruction such as MATTOD, and you retain all 64 bits, then the
timestamp will be unique for a given machine (assuming you don't set
the hardware clock back an hour as part of Daylight Savings Time
handling).

If multiple machines may be involved, then using the GENUUID (Generate
Universal Unique Identifier) might be considered.  GENUUID returns a
sixteen byte value (OK, it's a bit long) which is a combination of
the systems IEEE 802 address, local timestamp value, and a random
number.  The introduction of a random number does not eliminate the
possibility of duplication when moving the hardware clock back with DST
but sure does reduce the already small possibility.

If even this small possibility of duplication is too much, then one
could always borrow the idea of combining a system unique identifier
(as in GENUUID) along with a counter such as a 4 or 8 byte integer
maintained in a *USRSPC and incremented by way of CMPSWP.

Bruce

>
>>Well Jim I agree that the likelihood of a user job writing twice in
>>one timestamp click is impossible at this moment, perhaps they
>>will be able to in the future.
>
>I have already been bit by this in the past.  If two machines are writing
>data to a single distributed database you can indeed have the exact same
>User, Job, Job number and timestamp.  Let me tell you - it's rare, but it
>hurts when it happens.
>


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.