@Override public void close() throws SailException { try { try { if (namespaceStore != null) { namespaceStore.close(); } } finally { try { if (valueStore != null) { valueStore.close(); } } finally { if (tripleStore != null) { tripleStore.close(); } } } } catch (IOException e) { logger.warn("Failed to close store", e); throw new SailException(e); } }
@Override public void close() throws SailException { try { try { if (namespaceStore != null) { namespaceStore.close(); } } finally { try { if (valueStore != null) { valueStore.close(); } } finally { if (tripleStore != null) { tripleStore.close(); } } } } catch (IOException e) { logger.warn("Failed to close store", e); throw new SailException(e); } }
private boolean upgradeStore(File dataDir, String version) throws IOException, SailException { if (version == null) { // either a new store or a pre-2.8.2 store ValueStore valueStore = new ValueStore(dataDir); try { valueStore.checkConsistency(); return true; // good enough } catch (SailException e) { // valueStore is not consistent - possibly contains two entries for // string-literals with the same lexical value (e.g. "foo" and // "foo"^^xsd:string). Log an error and indicate upgrade should // not be executed. logger.error( "VALUE INCONSISTENCY: could not automatically upgrade native store to RDF 1.1-compatibility: {}. Failure to upgrade may result in inconsistent query results when comparing literal values.", e.getMessage()); return false; } finally { valueStore.close(); } } else { return false; // no upgrade needed } } }
private boolean upgradeStore(File dataDir, String version) throws IOException, SailException { if (version == null) { // either a new store or a pre-2.8.2 store ValueStore valueStore = new ValueStore(dataDir); try { valueStore.checkConsistency(); return true; // good enough } catch (SailException e) { // valueStore is not consistent - possibly contains two entries for // string-literals with the same lexical value (e.g. "foo" and // "foo"^^xsd:string). Log an error and indicate upgrade should // not be executed. logger.error( "VALUE INCONSISTENCY: could not automatically upgrade native store to RDF 1.1-compatibility: {}. Failure to upgrade may result in inconsistent query results when comparing literal values.", e.getMessage()); return false; } finally { valueStore.close(); } } else { return false; // no upgrade needed } } }