1 Reply Latest reply: Oct 26, 2011 12:18 PM by "Oracle, Sandra Whitman-Oracle" RSS

    Call to XmlContainer.putDocument not returning.

    893028
      I am new to Berkeley DB XML and have run into a problem. I am using Java 7 as my language and Netbeans 7.0.1 as my platform. I have reached the point where I can load documents into a container. I recently added a Dump function to display all of the documents in the container on the Output window of the platform. I used XmlContainer.getAllDocuments() and listed the XmlResults. That works fine. The problems is that when I next try to load any more documents into the container, the call to XmlContainer.putDocument() does not return. The platform hangs and I am forced to shut it down hard. This does not cause any corruption to the container. I can restart and add documents, but, if I try to dump again, I get the same behavior. The code that dumps is as follows:

              XmlResults xmlresults = xmlcont.getAllDocuments(null);
              XmlDocument xmldoc = xmlmanGCDB.createDocument();
              while(xmlresults.hasNext()) {
                      xmlresults.next(xmldoc);
                      DebugOut.println("----> XMLDocument Name: '" + xmldoc.getName() + "'");
                      DebugOut.println(xmldoc.getContentAsString());
              }

      The code that does the putDocument() that does not return is as follows:

              try {
                      xmlcontGCDB.putDocument(sName, sDocument);
              } catch (XmlException xmlex) {
                      ...
              }

      When this did not work, I tried to replace the getAllDocuments() call with various XQueries instead, but I was never able to get that to work. That I will put in the next post. Thanks.

      Edward Faichild
      fairce@comcast.net