}
@Override
public void removeAll(Iterator<? extends Statement> iterator) throws ModelRuntimeException {
if(this.isLocked()) {
throw new ModelRuntimeException("Model is locked, cannot perform an update.");
}
// do not auto-commit
assertModel();
try {
this.connection.begin();
try {
try {
// remove all
while(iterator.hasNext()) {
org.openrdf.model.Statement s = ConversionUtil.toOpenRDF(iterator.next(),
this.valueFactory);
this.connection.remove(s, this.openRdfContext);
}
this.connection.commit();
} catch(RepositoryException x) {
this.connection.rollback();
}
} finally {
this.connection.commit();
}
} catch(RepositoryException x) {
throw new ModelRuntimeException(x);
}
}