dbTalk Databases Forums  

Berkeley XmlDb acting strange

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Berkeley XmlDb acting strange in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sandesh
 
Posts: n/a

Default Berkeley XmlDb acting strange - 05-03-2006 , 11:43 PM






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


Reply With Quote
  #2  
Old   
Ron
 
Posts: n/a

Default Re: Berkeley XmlDb acting strange - 05-04-2006 , 02:29 PM






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


Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: Berkeley XmlDb acting strange - 05-04-2006 , 10:45 PM



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,updateConte xt);
else
myContainer.updateDocument(xmlDbTransaction,xmlDoc ument,updateContext);

} catch (XmlException e) {
if(e.getErrorCode() == XmlException.DOCUMENT_NOT_FOUND){
if(xmlDbTransaction == null)
myContainer.putDocument(xmlDocument,updateContext) ;
else
myContainer.putDocument(xmlDbTransaction,xmlDocume nt,updateContext);
}
else
throw e;

} catch (OutOfMemoryError e) {
throw new
Exception("BerkeleyXmlDb:replaceDocument():OutOfMe moryError:"+e.getMessage());
} catch (Exception e) {
throw new
Exception("BerkeleyXmlDb:replaceDocument():Excepti on:"+e.getMessage());
} finally {
if(updateContext != null){
updateContext.delete();
updateContext = null;
}
if(xmlDocument != null){
xmlDocument.delete();
xmlDocument = null;
}
}
}


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.