Originally posted by Goran Djuranovic
For those of you who have some experience in single- and multi- threading application processing, here is the situation:
1. Multiple HL7 files come into CloverLeaf from different sources/systems
2. HL7 files are translated into XML files
3. XML files are copied to a file server
4. XML files picked up by application and sent to SQL server for processing
Now, potentialy, two (or more) XML files can contain different information for the same record to be updated in the database.
For example, both files need to update Person's address whose PersonID="5". The address in the first file is "Apple St. #1", and the address in the second file is "Orange St. #2".So, in
single-threaded processing, the XML file that was detected first, is processed first. The second file is processed ONLY after the first file processing is finished. This eliminates the conflict/error of trying to update the same record twice at the same time.
In
multi-threaded processing, there is a huge possibility this error would occur, no question about it.
Single-threaded/Sequential processing = slow, but safe.
Multi-threaded/Simultaneous processing = fast, risky.
Now, if I had to develop an application that processes these XML files, which type of processing would you suggest and why?
Thanks in advance
Goran