I just did a similar thing and often used CF for data analysis.
1) Maintain a file upload table (parent table). For each file you upload, you should be able to keep a list of each file and what status it is (downloaded, processed, unprocessed)
2) Temp table to store all the lines of the data file. (child table) . Import the entire data file into a temporary table. Trying to do all this in memory will inevitably lead to some errors. Each row in this table will refer to a file upload table entry above.
3) Save processing status . For each line of the data file that you enter, set the tag "process / unprocessed". That way, if it breaks, you can start from where you left off. When you go through each line, set it as "processed".
4) Transaction - use cftransaction, if possible, do it all at once or at least one line at a time (with your 5 requests). Thus, if something is booming, you do not have one row of data that is half calculated / processed / updated / tested.
5) Once you are finished processing, set the file name entry in the table in step 1 so that it is "processed"
Using the above approach, if something fails, you can set it so that it starts from where it was stopped, or at least have a clearer way to start an investigation or in the case of a failure in your data at worst case. You will have a clear way to show the user the status of the current download processing, where it is located and where it was stopped if there was an error.
If you have any questions, let me know.
Other thoughts:
You can increase timeouts, give the VM more memory, put it in 64 bits, but all of them will only increase the capacity of your system. It is a good idea to do this for a call and to do it in combination with the above.
Java has some neat file handling libraries that are available as CFCS. if you encounter a lot of speed problems, you can use one of them to read it in a variable and then into the database
If you are playing with XML, do not use xml parsing. It works great for small files and is suitable when everything gets bigger. It says some cfc (check riaforge, etc.) that wrap some excellent java libraries for parsing XML data. Then you can create cfquery manually, if necessary, with this data.
source share