I need to read and fetch values from an XML file kept in the DAM. The file is 111 MB in size and takes forever to unmarshall and then equally long time to find the value I am looking for.
I am using JaxB to unmarshall the XML file and then iterating through the list. But most of the times I face timeouts and heapspace error while parsing it.
Is there any way to keep the unmarshalled object in the session and fetch it from there whenever a user needs to search some data in it ?
Any suggestions will be appreciated.
Solved! Go to Solution.
Views
Replies
Total Likes
Views
Replies
Total Likes
If Scott's suggestion to use the JCR doesn't work for you solving this problem is really more of a Java issue than a AEM on. If you create and OSGI service to handle searching the data you could unmarshall the file on system start up, store the unmarshalled object in a local variable of the service, and then any code that needs the XML data can call the OSGI service. In addition you might consider integrating redis or memcache (or something similar) to enhance the performance of you search of unmarshalled object.
Views
Replies
Total Likes
Views
Replies
Total Likes
I thought of doing that. So that we can make a JCR query every time we need to fetch some data.
But the file will have about 180,000 - 250,000 items (each item having a specific set of fields). Don't you think creating such a huge number of nodes in JCR will cause extra load on the JCR and can cause indexing issues in AEM6 ?
Just a hunch. I am not 100% sure of the impact of these many nodes being created/recreated daily. (The XML changes daily)
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes