Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-775

Jena TDB doesn't seem to release all file handles when dataset is closed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • TDB 1.0.2
    • None
    • TDB
    • None
    • Windows

    Description

      Jena TDB doesn't allow renaming of a TDB directory after a dataset has been opened and a model has been added. It appears as though there is an open file handle that is preventing the rename from succeeding. The following JUnit test fails:

      import java.io.File;
      import junit.framework.Assert;
      import org.junit.Test;
      import com.hp.hpl.jena.query.Dataset;
      import com.hp.hpl.jena.rdf.model.Model;
      import com.hp.hpl.jena.tdb.StoreConnection;
      import com.hp.hpl.jena.tdb.TDBFactory;
      import com.hp.hpl.jena.tdb.base.file.Location;
      import com.hp.hpl.jena.vocabulary.RDFS;
      
      @Test
      public void testRename() {
      	String path = "C:\\tmp\\indexTdb";
      	Dataset ds = TDBFactory.createDataset(path);
      	StoreConnection.make(path);
      	Model model = ds.getNamedModel(RDFS.Class.getURI());
      	ds.addNamedModel(RDFS.Class.getURI(), model);
      	ds.close();
      	StoreConnection.release(new Location(path));
      	File tdbRename = new File(path);
      	Assert.assertTrue(tdbRename.renameTo(new File("C:\\tmp\indexTdbMoved")));
      }
      

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              mpjarvis Matthew Jarvis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: