Kimbro, I found the problem.....
The Resources in the ResourceSet obtained from the XPathQueryService have an id that is null...therefore, trying to remove the resource as obtained from the ResourceSet fails. This is the same code as before, with the enhancement of the System.out.println in the testQuery() to show the resource.getId(). Here is the output: Running test: testQuery 1. [null] -------------------------- <?xml version="1.0"?> <highKey uniqueIdentifier="foo.com" value="1011719774551" xmlns:src=" http://www.dbxml.org/Query" src:col="/db/root/ocs" src:key ="6701000a459e2954000000eb8f326dfa" /> -Kevin Ross ============================================ <snip> ============================================ /** * Search the database. */ public void testQuery() throws XMLDBException { String xpathQuery = "/[EMAIL PROTECTED] = 'foo.com']"; ResourceSet resourceSet = getResourceSet(xpathQuery); ResourceIterator resourceSetIterator = resourceSet.getIterator(); int i = 0; while (resourceSetIterator.hasMoreResources()) { Resource resource = resourceSetIterator.nextResource(); System.out.println((++i) + ". [" + resource.getId() + "] \n--------------------------\n" + (String) resource.getContent() + "\n\n"); } } public ResourceSet getResourceSet(Collection collection, String xpathQuery) throws XMLDBException { XPathQueryService xpathQueryService = (XPathQueryService) collection.getService("XPathQueryService", "1.0"); return xpathQueryService.query(xpathQuery); } ============================================ <snip> ============================================ Kimbro Staken <[EMAIL PROTECTED] To: [email protected] group.com> cc: Subject: Re: Problem removing 01/21/2002 02:36 PM Please respond to xindice-users It looks right, what's the problem you're seeing? On Monday, January 21, 2002, at 12:22 PM, [EMAIL PROTECTED] wrote: > > Hello all, > > I am attempting to create a simplified test case to recreate the problems > I > am having with OutOfMemoryException, but I am having problem with > collection.remove(Resource) in my test case testRemoveAll(). > > Any ideas? > > > Kevin Ross > > > Kimbro Staken XML Database Software, Consulting and Writing http://www.xmldatabases.org/
