On 19/10/11 09:37, "Dr. André Lanka" wrote:
Hi all, :)

Hi André,


We're using Jena 2.6.4, ARQ 2.8.8 and TDB 0.8.10. We use multiple TDB
database instances in parallel. Each of it owns 40-50 file handles
during usage.

Is this one model per dataset?

To save resources we want to close rarely used database and re-open it
when needed. Currently we do this (basically) by

GraphTriplesTDB graph=(GraphTriplesTDB) rdfStore.getGraph()
TDBMaker.releaseDataset(graph.getDataset());
rdfStore.close();

where rdfStore is a Model created by a

rdfStore=TDBFactory.createModel(directory.getAbsolutePath())

createModel() returns a model i.e. a graph view of the dataset.

Datasets are the fundamental unit of persistent storage.

Closing a model does not close the dataset because, in general, there can be other models over the same dataset (the system does not track this - apps don't always close models so it won't work).

You might try:

  graph.getDataset().close()

which closes the dataset if you know there is one one model per dataset.

DatasetGraphTDB.close does a TDBMaker.releaseDataset - you would not need that.


Unfortunately not only the file handles remain open: With each call to
TDBFactory.createModel additional 40 file handles are opened. This ends
up in an IOException due to too many open files.

Perhaps we use the framework the wrong way... Does someone has an idea
what the problem could be?

BTW: rdfStore.isClosed() gives true (in our case) even after a call to
rdfStore.close(). The same applies to graph.isClosed() and graph.close().

Thanks in Advance
André

You might also consider putting all the models in one dataset as named graphs. The set of file handles is per-dataset.

        Andy

Reply via email to