@Override protected void startTransactionInternal() throws SailException { if (!sail.isWritable()) { throw new SailReadOnlyException("Unable to start transaction: data file is locked or read-only"); } super.startTransactionInternal(); sail.cancelSyncTask(); }
@Override protected void addWithoutCommit(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException { try { sailConnection.addStatement(subject, predicate, object, contexts); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override protected void startTransactionInternal() throws SailException { if (!sail.isWritable()) { throw new SailReadOnlyException("Unable to start transaction: data file is locked or read-only"); } super.startTransactionInternal(); sail.cancelSyncTask(); }
@Override protected void removeWithoutCommit(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException { try { if (subject == null && predicate == null && object == null) { sailConnection.clear(contexts); } else { sailConnection.removeStatements(subject, predicate, object, contexts); } } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override protected void startTransactionInternal() throws SailException { if (!nativeStore.isWritable()) { throw new SailReadOnlyException("Unable to start transaction: data file is locked or read-only"); } boolean releaseLock = true; try { if (txnLock == null || !txnLock.isActive()) { txnLock = nativeStore.getTransactionLock(getTransactionIsolation()); } super.startTransactionInternal(); } finally { if (releaseLock && txnLock != null) { txnLock.release(); } } }
@Override public void setNamespace(String prefix, String name) throws RepositoryException { try { boolean local = startLocalTransaction(); sailConnection.setNamespace(prefix, name); conditionalCommit(local); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override protected void startTransactionInternal() throws SailException { if (!nativeStore.isWritable()) { throw new SailReadOnlyException("Unable to start transaction: data file is locked or read-only"); } boolean releaseLock = true; try { if (txnLock == null || !txnLock.isActive()) { txnLock = nativeStore.getTransactionLock(getTransactionIsolation()); } super.startTransactionInternal(); } finally { if (releaseLock && txnLock != null) { txnLock.release(); } } }
@Override public void removeNamespace(String prefix) throws RepositoryException { try { boolean local = startLocalTransaction(); sailConnection.removeNamespace(prefix); conditionalCommit(local); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override public void clearNamespaces() throws RepositoryException { try { boolean local = startLocalTransaction(); sailConnection.clearNamespaces(); conditionalCommit(local); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override public void clear(Resource... contexts) throws RepositoryException { OpenRDFUtil.verifyContextNotNull(contexts); try { boolean local = startLocalTransaction(); sailConnection.clear(contexts); conditionalCommit(local); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }