niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
· nixdoc.net · man pages · Linux HOWTOs · FreeBSD Tips · Forums
navigation Forum index » Databases » Berkeley DB
Berkeley XmlDb acting strange
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
sandesh
*nix forums beginner


Joined: 03 Oct 2005
Posts: 10

PostPosted: Thu May 04, 2006 4:43 am    Post subject: Berkeley XmlDb acting strange Reply with quote

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

PostPosted: Thu May 04, 2006 7:29 pm    Post subject: Re: Berkeley XmlDb acting strange Reply with quote

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

PostPosted: Fri May 05, 2006 3:45 am    Post subject: Re: Berkeley XmlDb acting strange Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Thu Sep 09, 2010 5:52 am | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix + MySQL error: very strange variable %s iWarior Postfix 0 Mon Aug 25, 2008 2:01 pm
No new posts Strange problem with Sequence.. please help.. Krist Server 4 Fri Jul 21, 2006 7:30 am
No new posts VERY strange C anomaly Bernard Liang C 9 Thu Jul 20, 2006 9:32 pm
No new posts Berkeley db XML & FreeBSD mo Berkeley DB 0 Thu Jul 20, 2006 9:15 pm
No new posts strange error when importing a module Robin Becker python 1 Thu Jul 20, 2006 4:04 pm

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum |  email marketing service
 
Sponsors: Mobile computing articles | Free Animated Greetings | Cheap Home Insurance | Breast Enlargement | Debt Help
Privacy Policy
[ Time: 3.4799s ][ Queries: 17 (3.4544s) ][ GZIP on - Debug on ]