Bill H. wrote on 04/28/2004 12:27:30 AM:

> SYSTEM(19) on D3:
> Returns a unique item-id consisting of the current system date in
internal
> format, followed immediately by the current system time in seconds. If
more
> than one item-id is generated in a second, an alpha character is appended
to
> the item-id.

The best way to simulate this - on UniData, UniVerse, or indeed on D3 - is
to roll your own solution that doesn't involve contention.  When I was
working on a Sequoia Pick system we used SYSTEM(19) rather extensively.  It
was an easy way for multiple processes to generate unique keys to a file.
We thought it was a great way to avoid the bottleneck created by a "next
key" record in a control file.  We knew that having multiple processes
banging against a single locked record was a bottleneck and we pounced upon
this wonderful thing called SYSTEM(19).  What a wonderful way to avoid
bottlenecks.  I was young - well younger - then, and didn't understand the
way UNIX worked.  There was just this magical facility available, so it was
used with abandon.  It seemed to be the answer to our problems.

Then we saw that the system started crawling and, after much work, came to
the conclusion that the processes using SYSTEM(19) were the cause.  That's
when I started learning UNIX terms like semaphore.  In other words, when
you're guaranteeing uniqueness system-wide, you're going to have to bind on
something.  That was lesson #1.

Lesson 2 reared its ugly head when we were suddenly missing records during
a batch update process.  After tearing the application apart, and
scrutinizing everything including the IDs of the records in a transaction
file, we finally discovered that we were over-writing records.  As  Bill H.
mentioned, the date and time was suffixed with a single character.  If I
recall correctly, they started with the letter A, then incrimented from
there.  I think when they got to Z they started with numerals.  They might
have also included some non-alpha-numeric characters.  But with 1200 users
on a 16-CPU system, there were times when we used all of the available
characters in a second, and it started back at the beginning.  We were just
blindly writing records with SYSTEM(19) as the key, so earlier records
within a second were being overwritten by later records within the same
second.

Clearly, SYSTEM(19) wasn't the best approach.  Since we didn't care about
the contents of the ID - only system-wide uniqueness - we started using
something like this: date*time*port*seqno where date and time represented
the beginning of the current process and seqno was a number incremented
within the program.  This was guaranteed to be unique system-wide.  To our
great surprise and pleasure, performance also went through the roof, since
there was no longer any chance for a bottleneck.

So, as a long answer to Eugene's short question - with some old codger
reminiscence mixed in - no, SYSTEM(19) isn't available on UniData.
Rejoice!

Tim Snyder
IBM Data Management Solutions
Consulting I/T Specialist , U2 Professional Services

[EMAIL PROTECTED]
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to