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



On 8/13/2014 7:00 AM, Vinay Gavankar wrote:
I also need the records to be written in the sequence they came in (thru
the data queue).

Here is a scenario where the records may not be in sequence:

Let us say the Audit file already has seq 99998 for ID ABC.

Then there are 3 instances of the main file update for ID ABC one after the
other in the data queue, which get picked up by three different instances
of the program in question.

The first instance of the program gets the first record, and goes into the
loop to determine the lowest sequence (which is 99998 as of now) and write
a new record (which would be 99997).

BEFORE the 99997 record is written by the first instance of the program,
the second instance of the program gets the second record, and goes into
the loop to determine the lowest sequence (which is still 99998) and write
a new record (which would be 99997).

The first instance of the program now completes it loop and writes the
99997 record successfully.

The second instance is still in it's loop.

Now, the third instance of the program gets the third record, and goes into
the loop to determine the lowest sequence (which is 99997 now) and write a
new record (which would be 99996).

The second instance now completes it write of 99997, finds an error, and
goes back in the loop. Now, it finds 99997 as the last record and intends
to write 99996.

The third instance completes its loop and writes 99996 successfully.

The second instance encounters one more error on write, and in the next
loop writes 99995.

Here, I have all 3 records written successfully, but are out of sequence.

What does 'out of sequence' mean? Are the sequence numbers somehow
linked to the job that produced the record? Let's say that there is no
conflict, no duplicate on a write, and the current system writes 3 rows:

Job 1 - row 99999 rrn 1
Job 2 - row 99998 rrn 2
Job 3 - row 99997 rrn 3

Now, the same 3 jobs write some more records; but this time, 'out of
sequence' as described above:

Job 1 - row 99996 rrn 4
Job 3 - row 99994 rrn 5
Job 1 - row 99995 rrn 6
Job 2 - row 99993 rrn 7

Are the contents of the file somehow 'wrong' because the various jobs
wrote 'out of sequence'? The point of this is that 'in sequence' seems
arbitrary if any job can write any sequence number at any time.

Given that an index would present the records in sequence number order,
not in the order they were written (RRN), I don't understand why the RRN
is more important than the sequence number.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.