| Author |
Message |
sandesh *nix forums beginner
Joined: 03 Oct 2005
Posts: 10
|
Posted: Thu May 04, 2006 4:43 am Post subject:
Berkeley XmlDb acting strange
|
|
|
Hi,
I have got one Berkeley XmlDb container which is indexed and contains
around 7000 documents which leads to a size of around 2 GB.
When I go to command prompt and look for a specific document
i.e getDocument XYZ.xml it says one document found and displays
document
but when I do removeDocument XYZ.xml it doesnt find any document to
remove.
I tried same thing with java code also when I tried updating the
document it threw an exception saying no document found then I caught
that exception and tried inserting the document then it trew an
exception saying document already exist.
I dont know how to handle this problem and it is creating night mare
to me when I try to do incremental updation of the data.
Please help me with this.
Regards
Sandesh |
|
| Back to top |
|
 |
Ron *nix forums Guru Wannabe
Joined: 01 Apr 2005
Posts: 157
|
Posted: Thu May 04, 2006 7:29 pm Post subject:
Re: Berkeley XmlDb acting strange
|
|
|
Hi,
Are you running with transactions? If you use the shell are you using
the same environment as your application?
Please post your Java code here that demonstrates the problem.
Ron
Berkeley DB
Oracle Corporation |
|
| Back to top |
|
 |
sjcitfriends@gmail.com *nix forums beginner
Joined: 05 May 2006
Posts: 1
|
Posted: Fri May 05, 2006 3:45 am Post subject:
Re: Berkeley XmlDb acting strange
|
|
|
Hi,
Right now I am not running with transactions, when I loaded the
documnets with transactions it started creating huge log files .
the java code looks like this
public void replaceDocument(String collectionPath,String
docName,Document doc) throws Exception {
XmlUpdateContext updateContext =null;
XmlDocument xmlDocument = null;
try {
updateContext = xmlManager.createUpdateContext();
myContainer = getCollection(collectionPath,false,true);
xmlDocument = xmlManager.createDocument();
xmlDocument.setName(docName);
xmlDocument.setContent(SangamUtils.node2String(doc));
if(xmlDbTransaction == null)
myContainer.updateDocument(xmlDocument,updateContext);
else
myContainer.updateDocument(xmlDbTransaction,xmlDocument,updateContext);
} catch (XmlException e) {
if(e.getErrorCode() == XmlException.DOCUMENT_NOT_FOUND){
if(xmlDbTransaction == null)
myContainer.putDocument(xmlDocument,updateContext);
else
myContainer.putDocument(xmlDbTransaction,xmlDocument,updateContext);
}
else
throw e;
} catch (OutOfMemoryError e) {
throw new
Exception("BerkeleyXmlDb:replaceDocument():OutOfMemoryError:"+e.getMessage());
} catch (Exception e) {
throw new
Exception("BerkeleyXmlDb:replaceDocument():Exception:"+e.getMessage());
} finally {
if(updateContext != null){
updateContext.delete();
updateContext = null;
}
if(xmlDocument != null){
xmlDocument.delete();
xmlDocument = null;
}
}
} |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|