The Importance of Atomicity
In multi-threaded computer environments, the CPU provides multiple threads of execution concurrently within a single process by sharing resources like memory and files. ‘Atomicity’ refers to an ‘atomic transaction’ in databases, which is irreducible and indivisible from other operations.
In eFORMz, atomicity is vitally important in a number of processes, features and utilities, because eFORMz creates and copies files frequently. If those processes aren’t completed, before the file is renamed for instance, the result may be corrupted data.
A frequent example of atomicity is a banking transaction, where the bank account needs to be locked during a transaction to ensure that withdrawals occur on the proper account balance. Performing the action in atomic transaction ensures the data, in this case the account balance, remains in a consistent state.
In eFORMz, the type of atomicity employed can be seen in the Director Toolkit, where files are copied to different names, file extensions are changed or PDFs are created. Here is an example from the configuration tab using DOS commands:
- External command: cmd /c “copy <directory>\<datafilename>.<datafileext> %0”
- External command: cmd /c “ren %0 *.txtx”
Here the data file is copied to a new file called %0 in own command window. After the copy is completed, the file is renamed with a .txtx. The rename command is ‘atomic’ in that it occurs immediately, whereas the copy command requires an unknown duration, depending on many factors like bandwidth, cpu speed, file access rates, etc.
Try to consider atomicity when using eFORMz, especially with file age selector, eSubmit, creating PDF files with .hld extensions, renaming of files, among others.