Progress
Programming
Handbook
Transactions with File Input
You must be especially careful when you process transactions that read input from a text file. If a crash occurs, the active transaction is backed out of the database, but you will not automatically know how far processing proceeded in the text file. To handle this, you must either:
- Restore the database and rerun the procedures that were running when the system failed.
- Run all data input processes as a single transaction (this has record locking implications as well as implications in terms of the size of the before-image file for the transaction).
- Have a way to determine how many of the input data lines were processed and committed to the database so that you do not rerun lines that were successfully processed by a procedure.
One technique for doing this is to save the filename and the last line number in a database table, since changes in this status information can be synchronized with the corresponding database updates.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |