Search in sources :

Example 1 with SPARQLUpdate

use of org.eclipse.rdf4j.repository.sparql.query.SPARQLUpdate 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.");
        }
    }
}
Also used : UpdateExecutionException(org.eclipse.rdf4j.query.UpdateExecutionException) RepositoryException(org.eclipse.rdf4j.repository.RepositoryException) SPARQLUpdate(org.eclipse.rdf4j.repository.sparql.query.SPARQLUpdate)

Aggregations

UpdateExecutionException (org.eclipse.rdf4j.query.UpdateExecutionException)1 RepositoryException (org.eclipse.rdf4j.repository.RepositoryException)1 SPARQLUpdate (org.eclipse.rdf4j.repository.sparql.query.SPARQLUpdate)1