Re: [bdbxml] environment creation takes too long/hangs

George Feinberg <[email protected]> Mon, 17 Apr 2006 10:29:26 -0400
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
> I have a similar question.
>
> So far, my application has been working without an environment and  
> has been working just fine. However, it seems wrong that I have to  
> put in the root directory for my container files everywhere, so I  
> did want to run with an environment. The first time around the  
> creation is speedy, just like without it. However, the second time  
> around, it gives lots of errors, saying I need to run recovery,  
> though I do not see why.
>
> From reading the mailing list and the guides, I figured it was  
> because I wasn't closing my containers. Currently my application is  
> running on creating one environment and XmlManager at the beginning  
> of the run and then just opening a container every time I need one.  
> The problem is, if I call xContainer.delete() or .close(),  
> everything after it stops running - the application just terminates.
>
> I also tried calling XmlManager.close() at the end, but I get that  
> some database handles are not closed, and the same error happens  
> with the environment.
>
> Any ideas how to fix this? I am really confused (this is with using  
> Java).

Itay,

You should generally use the .delete() methods rather than .close().

Your problem could be with opening too many XmlContainer objects.
You only need one for each actual container, and that can be shared  
among
your threads.  Are you doing this?

If so, you should be able to just delete() them when done with a  
container.
If that has problems, it'd be good to know what.    You also need to be
sure to delete() any objects that may hold references to the  
XmlContainer,
notably XmlResults, XmlValue, and XmlDocument.

There's an FAQ entry on this:
	http://dev.sleepycat.com/resources/faq_show.html?id=79

Regards,

George
>


------------------------------------------
To remove yourself from this list, send an
email to [email protected]