5 Replies Latest reply on Jun 27, 2011 9:14 AM by 655560

    createInputStream fails while createLocalFileInputStream succeeds

      I've been doing some testing on using Berkeley DB in our organization for use with large XML documents (10MB to 500MB). I was using this basic construct to load documents into the database:

      XmlManager mgr = null;
      XmlContainer cont = null;
      Environment env = null;


      InputStream fis = new FileInputStream( someFilePath );
      XmlInputStream xis = mgr.createInputStream( fis );
      cont.putDocument( docName, xis );

      However, for larger databases this produces the following error:

      XmlContainer addAsset: Error: Unknown exception during NsSAX2Reader parse File: \testhome\bdbcn\msi\dbxml-2.5.16\dbxml\src\dbxml\nodeStore\NsSAX2Reader.cpp Line: 36

      Another post in another forum indicates that error messages of this nature may be due to memory leaks in the JNI implementation.

      I've since altered this:

      XmlInputStream xis = mgr.createInputStream( inputStream );
      XmlInputStream xis = mgr.createLocalFileInputStream( someFilePath );
      cont.putDocument( docName, xis );

      which allows me to add much larger documents without exception.

      Could a developer look into the implementation problem associated with createInputStream() or otherwise indicate to me how my use is incorrect?