Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a question on how to stream large MTOM attachment response at the client side from memory to an Oracle database without any temporary disk usage.

I already have a working implementation which does following things in sequence:

1) Parsing of entire MTOM response (used xercesImpl to avoid OutOfMemory error)

2) Saving the parsed data to CSV file on disk

3) Reading CSV row by row in a loop and do 3a and 3b in each iteration until all the records are consumed:-

3a) Additional processing on CSV row data in memory.

3b) Loading the processed row data from memory to an Oracle database.

The above implementation is working fine but it's not very efficient since we are getting the entire response in memory before saving it to disk and then again start reading records back from disk to memory before loading into a database.

I want to avoid the entire disk usage flow which means no CSV file or any interim temporary file.

I have tried the StreamingAttachmentFeature with both eager and lazy parsing along with StreamingDataHandler but it was creating a temporary file on disk and saved the entire response in it.

Thanks in advance for your help.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900