Search in sources :

Example 16 with UpdateProcessor

use of org.apache.jena.update.UpdateProcessor in project jena by apache.

the class ServerCtl method resetServer.

/*package*/
static void resetServer() {
    if (countServer.get() == 0)
        throw new RuntimeException("No server started!");
    if (CLEAR_DSG_DIRECTLY) {
        Txn.executeWrite(dsgTesting, () -> dsgTesting.clear());
    } else {
        Update clearRequest = new UpdateDrop(Target.ALL);
        UpdateProcessor proc = UpdateExecutionFactory.createRemote(clearRequest, serviceUpdate());
        try {
            proc.execute();
        } catch (Throwable e) {
            e.printStackTrace();
            throw e;
        }
    }
}
Also used : UpdateProcessor(org.apache.jena.update.UpdateProcessor) Update(org.apache.jena.update.Update) UpdateDrop(org.apache.jena.sparql.modify.request.UpdateDrop)

Aggregations

UpdateProcessor (org.apache.jena.update.UpdateProcessor)16 UpdateRequest (org.apache.jena.update.UpdateRequest)7 Test (org.junit.Test)7 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)3 UpdateDrop (org.apache.jena.sparql.modify.request.UpdateDrop)3 Update (org.apache.jena.update.Update)3 SQLException (java.sql.SQLException)1 SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)1 After (org.junit.After)1 Before (org.junit.Before)1