Ideas Please (File Sequencing)

Hello All

Hope someone can help me with an idea or two on how to approach the following situation;

I currently have a process that generates sequenced files. The sequencing is very important and skipping sequences are not allowed. The applicaton has a single thread that consume data produced buy other threads in the application and this thread is dedicated to file generation and sequecing. When the application encounter a problem it does a rollback and exit. when it restarts it picks up where it left off and everything works fine.

We are starting to experience performance problems though, it simply can't keep up. We need to make the application scalable and I would like to do this by running multiple instances of the application.

My problem is sequencing the files. Everything will work fine so long as no exceptions are encountered, the multiple processes will share a memory area where the sequence will be maintained. But what if one process encounter a problem and exists? When it restart the shared sequence would be have been incremented multiple times.

Can someone suggest an elegant method of approaching this problem?

The application is written in C and is currenty running on TRU64 but will be moved to HPUX early next year.

Thank you,

B

Is the sequence number purely part of the file name or is it embedded in the file itself?

The sequence number is part of the file name AND contained in the file.

Individual items in the file carry the sequence to allow tying them to the file they arrived in on the remote system following their consumption, loading, and the subsequent destruction of the file.

B

Can you generate a legal "empty" file?

Can you generate the file, then fixup all the sequence references once you have it complete?

Hello Porter

No, generation of empty files are not allowed. A file will not be generated if there are no data.

Yes, I will be able to generate a file without sequence information and update, re-write, it as a post process.

B

That is what I would opt for.

Basically generate the file without sequence number, then when you know you won't need to rollback (past the point of no return), grab a sequence number and post process.

Cool idea, thanks, will give it some thought.

How are you dividing the work between the processes? And what is the significance of the sequence? Could you have a driver process that assigns a sequence and a range of transactions to the other processes? So if a process aborts, it can be re-executed with the same sequence and range of transactions while the other processes continue with their assigned work.

Kahuna

The processes will be consuming from an Oracle Advance Queue, so they will be grabbing data out of it as fast as they can.

The significance of the sequence, it is important because downstream processes use it to make sure that no files are lost during transmission.

Preserving the sequence and re-using it, interesting. Will add it to my list of possible solutions.

Thanks,

B