final String id = feature.getID();
final long featureId = ArcSDEAdapter.getNumericFid(id);
final SeObjectId objectID = new SeObjectId(featureId);
final String qualifiedName = featureType.getTypeName();
final SeDelete seDelete = (SeDelete) createStream(SeDelete.class);
final Command<Void> deleteCmd = new Command<Void>() {
@Override
public Void execute(ISession session, SeConnection connection) throws SeException,
IOException {
try {
// A call to SeDelete.byId immediately deletes the row from the
// database. The application does not need to call execute()
// try{
seDelete.byId(qualifiedName, objectID);
// }catch(SeException e){
// final int FID_DOESNT_EXIST = -22;
// if(e.getSeError().getSdeError() == FID_DOESNT_EXIST){
// //ignore
// }else{
// throw e;
// }
// }
versionHandler.editOperationWritten(seDelete);
if (handleTransaction) {
session.commitTransaction();
}
} catch (IOException e) {
if (handleTransaction) {
try {
session.rollbackTransaction();
} catch (IOException e1) {
LOGGER.log(Level.SEVERE, "Unrecoverable error rolling "
+ "back delete transaction", e);
}
}
throw new DataSourceException("Error deleting feature with id:" + featureId, e);
} finally {
if (seDelete != null) {
try {
seDelete.close();
} catch (SeException e) {
LOGGER.log(Level.SEVERE,
"Unrecoverable error rolling back delete transaction", e);
}
}