}
@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
this.assertModel();
try {
this.connection.begin();
try {
try {
// add
while(iterator.hasNext()) {
Statement s = iterator.next();
org.openrdf.model.URI context = ConversionUtil.toOpenRDF(s.getContext(),
this.valueFactory);
org.openrdf.model.Statement sd = ConversionUtil.toOpenRDF(s,
this.valueFactory);
this.connection.remove(sd, context);
}
this.connection.commit();
} catch(RepositoryException x) {
this.connection.rollback();
}
} finally {
this.connection.commit();
}
} catch(RepositoryException x) {
throw new ModelRuntimeException(x);
}
}