use of org.eclipse.rdf4j.query.UpdateExecutionException in project rdf4j by eclipse.
the class SPARQLUpdateOperation method execute.
public void execute(RepositoryConnection con) throws RepositoryException {
try {
Update preparedUpdate = con.prepareUpdate(QueryLanguage.SPARQL, getUpdateString(), getBaseURI());
preparedUpdate.setIncludeInferred(isIncludeInferred());
preparedUpdate.setDataset(getDataset());
if (getBindings() != null) {
for (Binding binding : getBindings()) {
preparedUpdate.setBinding(binding.getName(), binding.getValue());
}
}
preparedUpdate.execute();
} catch (MalformedQueryException e) {
throw new RepositoryException(e);
} catch (UpdateExecutionException e) {
throw new RepositoryException(e);
}
}
use of org.eclipse.rdf4j.query.UpdateExecutionException in project rdf4j by eclipse.
the class SPARQLConnection method commit.
public void commit() throws RepositoryException {
synchronized (transactionLock) {
if (isActive()) {
synchronized (transactionLock) {
SPARQLUpdate transaction = new SPARQLUpdate(client, null, sparqlTransaction.toString());
try {
transaction.execute();
} catch (UpdateExecutionException e) {
throw new RepositoryException("error executing transaction", e);
}
sparqlTransaction = null;
}
} else {
throw new RepositoryException("no transaction active.");
}
}
}
Aggregations