Murray Altheim wrote:
Vadim Gritsenko wrote:
BTW, you still might want to shutdown database -- with today's changes, it will close all file descriptors properly.
Vadim,
I was literally just going to ask that question: what is the best way to shut things down? I note there's a number of shutdown() methods available.
You wrote earlier today:
[...]
> Ok, I've added IndexManager.close(), CollectionManager.close(), and
> implemented Collection.close().
>
> Now you can shutdown database using CollectionImpl.shutdown(), this will
> call Collection.close() on root collection, which should close
> everything. One downside... Need to integrate this with XMLTools.
Sorry to be a bit dense about this. So just to be sure, since we've got my code example on the Wiki page, to shutdown would I call
rootCollection.shutdown();
and that'd be it? It would also shut down the DatabaseInstanceManager and CollectionManagementService? Or would these still need to be shutdown separately? In my 1.0 code I had to shut them down separately when I shut down the kernel.
CollectionManagementService by itself does not have shutdown() method, and DatabaseInstanceManager.shutdown() invokes shutdown on root collection. It works like this:
DatabaseInstanceManager.shutdown()
.embed.CollectionImpl.shutdown()
Database.close()
Collection.close()
IndexManager.close()
Filer.close()
CollectionManager.close()
for each subcollection:
Collection.close()So you can use either DatabaseInstanceManager (more oficial way), or CollectionImpl. In case of xml-rpc, shutdown operation currently no-op.
Vadim
