I'm deleting a feature from a shapefile with this code:
IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactory();
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspaceFactory.openFromFile("C:/Users/me/Desktop", 0);
IFeatureClass featureClass = featureWorkspace.openFeatureClass("sondage");
IWorkspaceEdit wse=(IWorkspaceEdit)featureWorkspace;
IQueryFilter qf=new QueryFilter();
String s="SALB 01";
qf.setWhereClause("n_sondage='"+s+"'");
IFeatureCursor pFeatureCursor = featureClass.search(qf, false);
int id=pFeatureCursor.nextFeature().getOID();
wse.startEditing(false);
wse.startEditOperation();
IFeature feat=featureClass.getFeature(id);
feat.delete();
wse.stopEditOperation();
wse.stopEditing(true);
It works, but when I called this function in another class in the same project, the feature is not deleted and the shape couldn't be drawn any more.