Hello,
I am trying to implement proper transaction handling based on the latest
Jena TDB version.

This is how I roughly initialize the model entities (I work with Jena's
OntModel):

class ConnectorWrapper
   public void init() {
      Dataset tdbDataSet = TDBFactory.createDataset(directory);
      model = tdbDataSet.getNamedModel(this.getOntologySchemaIRI());
       this.ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM,
model);
   }
}

I ran into some problems.

   1. tdbDataSet.abort() is not working for me. As far as I got from the
   documentation, the OwlModel does not support transactions. Did I got that
   correct? Is there any kind of workaround?

   2. How do I properly close/destroy a Jena Dataset? I am running into the
   situation that I have several "Connector" instances (within one Thread),
   which wrap an instance of the Jena Dataset. However, only the first
   initialization succeeds, for the latter I get something like "transaction
   is not active". I also get some errors in the command line "ERROR
   com.hp.hpl.jena.tdb.transaction.BlockMgrJournal - **** Not active: 1"
   although I call "tdbDataSet.close() and tdbDataSet.end()" before calling
   init() again. Is TDBFactory.createDataset(directory) the correct way to
   retrieve a dataset-instance, or should I call another method? Does my
   initialization approach seem ok?

Thank you very much and best regards,
Andreas

Reply via email to