Duncan,
Thanks for the prompt response. Yes, ... my newbie'ness re CFML is evident. Hence, ... I do not possess the ability to code in JAVA.
Any ideas? - else I'm screwed.
Richard
Main Topics
Browse All TopicsCan you help?
I have a daily maintenance task I'm trying to run in CF8 that will load a remote XML file (6mb in size) and parse, via ColdFusion8, into a simply MySQL Table.
I'm getting java.lang.OutOfMemoryError
Alas I cannot parcel the remote source xml file into smaller pieces (as the file is not mine to parcel).
Is there a way to incrementally read the XML file and cache / managed / discretely load each XML 'row' into the MySQL database without the memory issue?
The code is pasted below +/- security.
Thanks! This is an essential and I'm stymied.
Richard
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Try Duncan's suggestion of saving the file to disk first (and using cfqueryparam) to see if that produces any improvements. XML parsers can be a memory hogs. Some more than others. So you might check your jvm settings as well.
Another option you might test is this article. It takes a slightly different approach to xml processing
http://www.bennadel.com/bl
You could also try loading the data directly into mySQL, if that is an option. I have not done it myself, but you could compare the performance and get an idea of which is the better option.
http://dev.mysql.com/doc/r
Business Accounts
Answer for Membership
by: duncancummingPosted on 2009-02-03 at 23:40:04ID: 23545661
I'd say straight after cfhttp, save that to a file using cffile or using the path and file attributes on cfhttp. Then at least you've got the XML file locally to start processing. At that point you may want to use Java functions to read the file rather than CFML.
wer.people .person[i] .XmlAttrib utes.distr ict#> er.people. person[i]. XmlAttribu tes.distri ct>
You don't need the ## on lines like:
<cfset var_district=#congress_ans
can just be written as
<cfset var_district=congress_answ
You might want to use <cfqueryparam> in your query, which should help the query run quicker.