You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Eric Zhang <yu...@ualberta.ca> on 2004/02/20 18:50:58 UTC
Load Big File?
Hi:
Is there anybody being able to load a big XML file to the database. I
know Xindice is not designed to do that, however, the limitation of a
string will easily be reached. I have a 11M xml file, when I try to load
it using the example from xindice's site(the one read the content of a
file to a string), it gives me an out of memory mistake.
I then tried to use create a DOM/other create resource way and load
it, which give me an error: XML:DB Exception occured 0
The script I used :
Test1:
File file = new File("test.xml");
byte[] temp1 = getBytesFromFile(file);
DocumentImpl aNode = new DocumentImpl(temp1);
XMLResource document = new
XMLResourceImpl("hehe",col,null,temp1) ;
col.storeResource(document);
Test2:
DocumentImpl aDOM = new DocumentImpl();
aDOM.createElement("hehehehe");
XMLResource document =
(XMLResource)col.createResource("hehe","XMLResource");
document.setContentAsDOM(aDOM);
col.storeResource(document);
Any idea?
--
Yue(Eric) Zhang
Database Analyst/DBA, TAPoR Project
Arts Department, University of Alberta
Edmonton, AB, Canada
Re: Load Big File?
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Eric Zhang wrote:
>Hi:
> Is there anybody being able to load a big XML file to the database. I
>know Xindice is not designed to do that, however, the limitation of a
>string will easily be reached. I have a 11M xml file, when I try to load
>it using the example from xindice's site(the one read the content of a
>file to a string), it gives me an out of memory mistake.
>
>
Increase the memory. Add parameters to the java:
-Xms128m -Xmx256m
and try again.
> I then tried to use create a DOM/other create resource way and load
>it, which give me an error: XML:DB Exception occured 0
>
>
Add -v parameter to see exception message / stack trace.
Vadim